Rafael Nadal won a "one in 1,000" match after coming from 5-1 and match point down to sink Daniil Medvedev 6-7 (3-7 ) 6-3 7-6 (7-4 ) at the ATP Finals in London and boost his bid to finish the year as world number one.
In a rematch of their marathon US Open final in September which Nadal won in five sets, the Spaniard looked on the brink of elimination as Medvedev broke his serve twice at the start of the third set.
But at 5-1 down Nadal wriggled out of match point against with a cute drop shot, and hot-headed Russian Medvedev promptly unravelled.
The 23-year-old began sarcastically applauding his coaching team as Nadal hauled him back game after game, edging the match ominously towards a tie-break.
Nadal duly got on the board at the O2 by wrapping up a dramatic victory in two hours 44 minutes.
"Today is one of these days that one time out of 1,000 you lose this match, and it happened today," said Nadal.
"I'm very happy for that, and very sorry for him, honestly, because to lose a match like this is tough, and it's painful.
"I feel very sorry for Daniil. He's a good guy, I think, and anyway, he should be very proud about all the things that he's doing.
"At 5-1, in that moment, what you think is probably in five minutes you are in the locker room, because that's the more normal thing.
"I played a great point, and then I was able to save that game. Even with 5-2 is so difficult to think about comeback against a player like Daniil.
"But at 5-3, of course I started to believe, because being only one break away, why not? I need to be there. I need to create the moment and I need to put the pressure.
"I created that pressure on him. And then of course he made couple of mistakes, no? But I think I played a good tie-break, too."
The win means Novak Djokovic has to win the title in order to have any chance of overhauling Nadal at the top of the rankings, making the Serbian's winner-takes-all clash with Roger Federer all the more mouth-watering.
Nadal, who was well below his best as he slumped in straight sets to Alexander Zverev in his first round-robin match, now faces young Greek star Stefanos Tsitsipas on Friday as he bids to reach the semi-finals.
Tsitsipas secured his place in the last four after beating defending champion Zverev.
The 21-year-old, who overcame Medvedev in their opening round-robin match, dispatched German Zverev 6-3 6-2.
"I can say I'm surprised by my performance today," said Tsitsipas.
"I did everything right and once again it was not just me but a whole bunch of excited people came to support me. It was a crew situation."