Novak Djokovic ruined Roger Federer's ambitions of a 100th career title as he outlasted his great adversary in three sets in an epic Paris Masters semi-final that stretched his remarkable unbeaten run to 22 matches.
In a 47th meeting between the two greats, the stubborn Djokovic simply refused to be beaten as he eked out a fourth successive victory over Federer in a tiebreak decider after three compelling hours.
It gave the Serbian the opportunity to mark his return to world number one on Monday by winning a record-extending fifth Paris title in Sunday's final against Russian Karen Khachanov, who earlier crushed Dominic Thiem 6-4 6-1.
Djokovic, who had complained of competing with flu-like symptoms in his previous matches this week, looked proud and relieved to repel a wonderful challenge from Federer, who appeared close to his imperious best.
Yet even though his serve was not broken once, it was still not enough for the 37-year-old Swiss, whose nerve failed him in an anti-climactic final tiebreak in which he served a double fault and made two more careless groundstroke errors.
Federer was seeking to become only the second man after Jimmy Connors to win a century of professional tour titles following his 99th win in Basel but fell agonisingly short.
The 20-time Grand Slam champion lost the first set despite having held set point in the tiebreak and had Djokovic in trouble in the final set when the Serb received a code violation at 4-4 for chucking his racket away in disgust after the Swiss had saved two break points.
Ultimately, though, Federer, who saved all 12 break points on his serve, saw his resilience ended as Djokovic extended his career lead over the Swiss to 25-22 after their longest-ever three-set duel.
It was the first time in their 12 years of battling that Djokovic had won four matches in succession against Federer, equalling the run that the Swiss himself had once achieved at the dawn of their rivalry.
Earlier, Khachanov showed why he is one of the finest young talents in tennis with a thunderous victory over Thiem.
The 22-year-old, 6ft 6in Russian, already the owner of two indoor hard court titles this year, moved one step away from the biggest title of his career, crushing his Austrian friend and practice partner in 70 one-sided minutes.
"It was one of my best matches, and what I'm happy about is that I was increasing my level, which shows that I'm becoming a better player," Khachanov, who reached his first Masters 1000 final said.
The 18th ranked Muscovite overpowered a third top-10 player in successive days, having hammered Alexander Zverev in the quarters and negotiated John Isner's huge serves in the last-16.
Thiem, the world number eight who on Friday had booked his place in the ATP Finals, was out of sorts and seemed rushed by the depth and power of Khachanov's groundstrokes.
Remarkably, the Austrian saw his powerful serve broken five times in a row by Khachanov at the end of the first set and throughout a surprisingly one-sided second.