Andy Murray fought with gritted teeth and weary limbs to hold onto his number one dreams and reach his first final at the ATP World Tour Finals.
Four days after he took three hours and 20 minutes to defeat Kei Nishikori, Murray was on court for 18 minutes longer in a 5-7 7-6 (7/5) 7-6 (11/9) victory over fourth seed Milos Raonic - breaking the tournament record for longest match for the second time.
Raonic twice broke Murray when he served for the match and saved three match points but could not take the one chance that came his way in a remarkable deciding tie-break that eventually went the way of the home favourite.
Murray cut a fatigued figure throughout and looked exhausted by the end, and the question must now be how much energy he will have left for Sunday's final.
Should Djokovic defeat Nishikori in the other semi-final, the fight for the year-end top ranking would come down to the last match of the tour season for the first time.
Murray has at least set a personal record of 23 straight victories, one better than his summer streak, but only a 24th will bring the golden end his remarkable season surely deserves.
Murray said: "It was obviously unbelievably tough. I had to fight very hard to get over the line. It was tough going into a tie-break having been broken twice serving for match.
"It was frustrating but a pretty amazing tie-break. I just managed to get there in the end.
"It was an amazing atmosphere, the longer the match went on the louder and better the crowd get. This is what we play for, for matches like this."
Murray admitted he will struggle to produce his best in the final, adding: "Obviously I'm tired. I've played so much tennis the last few months and long matches this week. I'll give it my best shot tomorrow with what I have."
Having effectively handed Murray the number one ranking by withdrawing ahead of their semi-final in Paris two weeks ago, Raonic now had the chance to deal a hammer blow to the Scot's hopes of keeping it.
This was the pair's sixth meeting this year and the big-serving Canadian was looking for his first win, but he came mighty close at both the Australian Open and Queen's.
Raonic, who had not beaten the Scot since 2014, headed into contest optimistic that the high stakes for Murray could work in his favour this time.
Murray had played his best tennis of the week in beating Stan Wawrinka on Friday and began in similar fashion but Raonic, who has shown no sign of the thigh injury he suffered in Paris, soon started to exert pressure.
Murray saved a break point in the third game and then three more in a long game at 4-4 where he was also given a time violation by umpire Damien Dumusois.
His resistance cracked two games later as a weary double fault gave Raonic the chance to serve for the set, which he took on his third set point.
The world number one roused himself at the start of the second set and created his first two break points of the match only to make routine errors on both.
And when he dumped a forehand into the net to trail 2-1 in the next game, he was in a deep hole. At least he could take heart from the Queen's final, when he fought back from a set and 3-0 down.
This time his recovery was less down to his own brilliance than a lapse from his opponent, who played a dreadful game and was broken to love.
That gave Murray and the crowd the lift they needed and the top seed nearly made it two breaks in a row only for Raonic to come up with a backhand half-volley that his sometime coach John McEnroe would have been proud of.
The final stages of the second set were nervy in the extreme, especially for Murray, but he made a great start to the tie-break and pulled off a half-volley even more outrageous than Raonic's to make it 4-1.
He was pegged back to 5-5 but was rewarded for being the aggressor as he made it one-set all.
With two hours and 20 minutes on the clock, this was already another epic encounter, and Murray had to fight through the fatigue again to save two more break points in the second game of the decider.
Murray looked certain to close the match out when he twice served for it but instead Raonic broke back both times, prolonging this crazy match even further.
The tie-break was a fitting denouement as both men produced their best to deny the other when match points came around until Raonic finally netted a forehand.