Roger Federer went into his Australian Open semi-final against Novak Djokovic giving himself a "three per cent" chance of victory and branded the experience "horrible".
Djokovic will contest a record eighth final at Melbourne Park on Sunday after a 7-6 (1) 6-4 6-3 victory over his old rival.
It was their 50th meeting, with Djokovic now leading 27-23, but this had a very different feel to most of those given there were doubts over whether Federer would even take to the court.
The 38-year-old's rollercoaster run through what on paper was a very kind draw had left him bearing the scars of two extraordinary contests against John Millman and Tennys Sandgren.
Federer had somehow managed to save seven match points in beating Sandgren in the quarter-finals despite the onset of a groin problem.
He took another medical timeout after the first set of this match and his movement was clearly affected again.
He finished the match feeling he had squeezed everything he could from the fortnight, saying: "At the end of the day, I guess I'm very happy.
"I've got to be happy with what I achieved. It was the maximum to get at this tournament, especially after the Millman and the Sandgren match.
"Today was horrible, to go through what I did. Nice entrance, nice send-off, and in between is one to forget because you know you have a three per cent chance to win. You've got to go for it.
"You never know. But, once you can see it coming, that it's not going to work anymore, it's really tough."
Despite the poor omens, including the fact he had not beaten Djokovic at a Grand Slam since 2012, it was Federer who came flying out of the blocks.
He was all over Djokovic's serve, breaking twice and moving to the brink of a third with the Serbian at 1-4 0-40.
Djokovic held on and that proved to be the turning point. Federer still had a chance to serve out the set but by then his opponent had found a better rhythm and he broke back to love.
The Serbian went to play a brilliant tie-break and from there it was largely a question of how long Federer could hang on.
Djokovic said: "I was trying to focus on myself. I'd been told by the team as well to prioritise my own things rather than really thinking about how he's feeling or how he's going to move, how he's going to play, but it's easier said than done.
"When I was on the court at the beginning, I was really paying too much attention on his movement. I wasn't in the right balance.
"I wasn't hitting the ball. I wasn't executing the shots the way I wanted it.
"It resulted with a 4-1 deficit and 0-40. I was just fortunate to serve well at those moments."
It is one of Federer's more extraordinary statistics that in more than 20 years of playing at the top level he has never failed to complete a match.
He revealed he talked with his team about that possibility and was grateful it did not come to that.
Djokovic paid tribute to Federer on court, and said afterwards: "Respect, it's all I can say. I did have retirements throughout my career. I know how it feels when you're hurt on the court.
"I think it's an amazing fact that he has never retired, not a single match, throughout his career. Huge respect for that.
"Obviously he was hurting. You could see it in his movement. Respect to him for trying his best. It's unfortunate that he was not at his best."
Federer will be only seven months short of his 40th birthday at the Australian Open next year but he is planning to be back at Melbourne Park.
He added: "You never know what the future holds, especially at my age. I'm confident.
"I'm happy how I'm feeling. No plans to retire. I hope to be back."
The Swiss added that he still thinks he can add to his 20 Slam titles: "I do believe that. I think by having the year that I had last year, also with what I have in my game, how I'm playing, I do feel that."
Djokovic can close to within three Grand Slams of Federer if he beats either Dominic Thiem or Alexander Zverev on Sunday.
The second seed called the doctor after the end of the first set and took a pill but insisted he feels in good shape for the final.
"I'm pleased with the way I've been feeling and playing," he said. "I dropped only one set so far.
"I have two days of no match right now, which actually is really good."