Roger Federer moved into the ATP Finals last four at the expense of Novak Djokovic with a scintillating win over his great rival at the O2 Arena.
Swiss third seed Federer, 38, won 6-4 6-3 in a round-robin match which eliminates the Serb second seed from the season-ending tournament in London.
Federer will meet top seed Rafael Nadal or Stefanos Tsitsipas in the last four.
Djokovic’s defeat also means Spain’s Nadal is guaranteed to finish as the year-end world number one.
Nadal, 33, is far from certain of reaching the last four himself, needing victory over Greek sixth seed Tsitsipas on Friday to have any chance.
However, if German seventh seed Alexander Zverev beats Russian fourth seed Daniil Medvedev then Nadal is out regardless of his result.
If results do go his way then Nadal will top the Andre Agassi Group and face Federer – who has finished second behind Austrian fifth seed Dominic Thiem in the Bjorn Borg Group – in Saturday’s semi-final.
Federer, who lost his opening match to Thiem, jumped for joy after clinching a victory which goes some way to avenging his defeat by Djokovic in an epic Wimbledon final in July.
‘I couldn’t be more happy’ – Federer avenges Wimbledon defeat
Anticipation for the first meeting between the pair since that enthralling Wimbledon final was high as they met on the other side of the English capital in a situation which few would have predicted before the tournament.
When the draw was made last week, most expected their final round-robin match to be a decider for who would top the group.
Yet both players came into it fighting for survival after Thiem blasted them off the court to earn back-to-back wins which assured the French Open finalist of a last-four spot at the O2 Arena for the first time.
Federer was the one who produced a high-quality performance at the crucial time, with Djokovic looking out of sorts and nursing an elbow injury in the final stages.
Federer dropped just three points on his serve in the first set, firing eight aces and winning all points behind his second serve, as even Djokovic’s famed defensive game could not cope with his accuracy.
While this victory will not completely make up for that bitter defeat at SW19, which denied him a 21st Grand Slam triumph, Federer’s delight at avenging it was clear.
Federer missed two championship points before going on to lose Wimbledon’s longest singles final in a historic final-set tie-break, but ruthlessly took his first opportunity here as Djokovic disintegrated.
Asked what he did differently at the O2, Federer said: “I won match point, I guess. It was so close at Wimbledon. It was a privilege to play that match, so many ups and downs.
“I couldn’t be more happy right now. I think I served great, had great anticipation, clear game-plan and it worked great tonight – hopefully not for the last time against Novak.”
BBC tennis correspondent Russell Fuller
Djokovic says Federer is a role model even for him – and amid the pain of losing, he was able to appreciate a vintage performance from the 38-year-old.
When Federer serves like he did in the first set, no-one who can live with him: even if Djokovic did invite some of the pressure on himself, by sending down three double faults in his first service game and a half.
Once broken in the second set, Djokovic cut a dejected figure who sensed his number was up, as Federer continued to glide rapidly around the court.
His victory ensures Nadal will be the year end number one for a fifth time. Federer and Djokovic have also managed that five times. There really is so little to separate these three extraordinary players.