London: The 38-year-old Roger Federer took a clinical win over long-time arch-rival Novak Djokovic in London, reaching his 16th semifinal out of 17 appearances at ATP World Tour Finals.

The defeat also meant that Djokovic could not challenge Rafael Nadal's world number one position, seeing the Spaniard finishing as year-end world number one for the fifth time.

Ahead of the 49th encounter between the two great players, Djokovic held a 26-22 advantage and won the last five meetings, including their five-set final at this year's Wimbledon Championships, Xinhua news reports.

But Federer dominated O2 Arena's indoor court on Thursday night, breaking Djokovic three times and only facing breakpoint once. The Swiss legend wrapped it up 6-4, 6-3 after 73 minutes.

"I played incredibly, and I knew I had to because that's what Novak does and I was able to produce. So it was definitely magical," Federer said.

Two days ago, Djokovic suffered a painful loss to Dominic Thiem, who came from behind to edge the in-form Serbian 7-6 (5), 6-3 and 7-6 (5).

"Mentally it was tough to lose a match like that a few nights ago," said Djokovic. "I started off this tournament amazingly. I felt great. Won Paris. Played really well. Just probably things kind of shifted in terms of the way I feel on the court, and my confidence level wasn't high today, so Roger could sense that and he used it very well."

Federer was second in Group Bjorn Borg behind Austrian Dominic Thiem. He will face the winner of Group Andre Agassi on Saturday. Tournament debutant Stefanos Tsitsipas leads Group Andre Agassi with two consecutive wins and has booked a semifinal berth.