Roger Federer revealed he was unaware how many match points he had saved after staging his second miraculous comeback of the Australian Open to reach the semi-finals.
The third seed had come back from 4-8 in a deciding tie-break to beat John Millman in round three, but that was put into the shade by his efforts against Tennys Sandgren.
The 100th-ranked American had seven match points in the fourth set of the biggest match of his life but Federer saved all of them and went on to win 6-3 2-6 2-6 7-6 (8) 6-3.
Federer struggled with a groin injury, taking an off-court medical timeout at 0-3 in the third set, and had difficulty moving to his forehand until the end of the tie-break.
By then he had saved three match points at 4-5 and four more in the tie-break, including three in a row from 3-6.
Federer said later: "Honestly, when they told me seven, I was like, 'What?' I thought it was three. It's such a blur at some point.
"I remember there were a few longer rallies on match points. I just said, 'If he can belt a backhand down the line, or run around and go huge, he's willing to take a chance', because you just don't know if you're going to get another opportunity for a match point like this.
"You've got to be a little bit careful. He did that. I thought it was the right play in that very moment by him. That's why I feel a bit bad in a way because I didn't feel like he did anything really wrong. It's just luck at some point.
"I've been on the other side as well. These ones just sting and they hurt. If you could obviously play them again, would you play them differently? But I could have blinked at the wrong time and shanked. That would have been it. I was incredibly lucky today."
Sandgren, who also reached the last eight here two years ago, cut an understandably disconsolate figure in his press conference as he reflected on what might have been.
"Obviously he played them well," the American said of the match points. "I could have played them better. I've run through them a bunch of times.
"When you survive that many times, you can't give a good player, let alone maybe the best player ever, that many chances to come back. They're going to find their game and start playing well."
After his struggles against Millman and Marton Fucsovics, where he also dropped the first set, Federer looked to have picked things up in the early stages.
But by the start of the second he was missing wildly with his forehand and it gradually became clear all was not well physically.
Federer was unhappy to be given a warning for swearing after being overheard by a line judge as his frustration about the tightness in his leg spilled over.
"I started to feel like my defence wasn't really there," he said. "That's also when I got the warning finally because I was upset about the pain I was feeling.
"Sometimes you can solve things with a medical timeout, but that was not really the case. Of course, already that third set was halfway gone anyhow, so it was just a matter of coming to terms with what do I have, what don't I have in my game.
"I figured in the fourth set things could go quickly or maybe I'll hang around for a bit, eventually he'll get the break, because he was playing very well."
Federer, who has never retired from a professional match, admitted he thought victory was probably beyond him, saying: "For the most time there I thought that was it.
"Of course, there's little sparkles where maybe not, then you're like, 'No, it is over'. Only maybe when I won that fourth set did I really think that maybe this whole thing could turn around."
For most of the fourth set it seemed inconceivable that Federer could find a way through but he somehow hung on and will hope the improved form he showed in the decider can be a good omen for the semi-finals.
He is optimistic he can recover in time and is not writing off his chances of a 21st grand slam title just yet.
He said: "You have an extra day, adrenaline, there's a lot of things. Two good nights of sleep, doctors, physios.
"Hopefully we'll find out that it's actually nothing bad, that it was just the groin that went really tight from playing a lot, from nerves, I don't know.
"If I can get through a match like this, through a match like Millman, you do believe. I only believe it once it's over, I shake the hand of the opponent."
No Data Analysis info