Roger Federer snapped Novak Djokovic's 23-match winning streak to reach the semi-finals of the ATP World Tour Finals last night

It was the most eagerly-awaited match of the group stages at London's O2 Arena and the capacity crowd of mostly Federer fans went home very happy after watching the Swiss upset the world No.1 7-5 6-2.

Djokovic had only lost a single set since beating Federer to win the US Open in September, while this was his first defeat indoors since 2012.

There was plenty at stake for Federer in his 43rd meeting with Djokovic, not least supremacy in their head-to-head.

The pair were tied at 21 apiece and a win for Djokovic, who is bidding for a fourth straight title, would have taken him ahead for the first time.

But the 28-year-old looked unusually flat and, once Federer had claimed the decisive break to win the opening set, a comeback never looked on the cards.

Djokovic is still in a good position to reach the last four, with a straight-sets win against Tomas Berdych, who lost to Kei Nishikori in the earlier match, on Thursday enough to put him through.

Federer had said in the build-up he did not feel far away from Djokovic's level despite the Serbian's dominance and the huge gap in ranking points.

He faced a break point immediately but a good serve helped him save it, and that seemed to settle him into the match.

Federer was managing to dictate just as much as Djokovic from the back of the court and it was the world number one that cracked first.

Djokovic saved one set point at 5-6 when Federer missed a forehand but a tentative smash from Djokovic - the only slight weakness in his game - led to a second.

This time Federer came up with a little piece of magic, feathering a backhand half-volley drop shot off a dipping pass onto the line.

The crowd roared their approval and, when Djokovic netted a backhand to trail 2-0 in the second, the writing seemed on the wall.

Federer played a loose game to give the advantage straight back but three more backhand errors from his opponent followed by a backhand pass that clipped the top of the net gave Federer another break for 4-2.

This time there was no lapse and, although Djokovic saved one match point, he put a backhand wide on the second, with Federer giving a little shake of the head as the world number one fruitlessly appealed to HawkEye.

Earlier, Nishikori and Berdych played out the first real contest of the tournament, the O2 Arena witnessing a third set for the first time this week before the Japanese player came through 7-5 3-6 6-3.

Nishikori had admitted he was ashamed after winning only two games against Djokovic in his opening match, but he righted the wrong and must now beat Federer and hope for a favour from Berdych if he is to reach the last four.