Rafael Nadal survived a serious examination by Grigor Dimitrov to reach the Australian Open semi-finals.
The Spaniard began the match as the only member of the world's top three in either the men's or women's draw still in the tournament, and for a long time his place looked far from secure.
Nadal did not find anything like his best form throughout the match but Dimitrov's inexperience showed at the crucial moments.
The 22-year-old held three set points in the third set but missed them all and it was Nadal who moved through to the last four with a 3-6 7-6 (7/3) 7-6 (9/7) 6-2 victory.
"I was so lucky," said Nadal. "Especially on one set point, he missed an easy one. The fourth set was for me and I'm very happy for that. I love this tournament. I'm very happy to be in the semi-finals after missing it last year. I suffered a lot."
This has been a breakthrough grand slam for Dimitrov, who is beginning to come up with results to match his considerable talent.
He had never previously been beyond the third round at a slam but looked at home on Rod Laver Arena as he broke the Nadal serve at the first opportunity.
The Spaniard had struggled against Kei Nishikori in round four, with a large blister on the palm of his left hand proving particularly troublesome.
Whether that was the reason or not, he certainly could not find his usual feel on the ball.
Dimitrov, who had won sets in all their three previous meetings, capitalised, hitting back from 0-30 down with four straight points to serve out the first set, clinching it with an ace.
It was the first set Nadal had lost all tournament, and the doubts grew when, having broken Dimitrov to start the second set, he handed the advantage straight back with three double faults in one game.
The world number one was rock solid in the tie-break, though, taking it with a superb backhand winner on the run that left him by the umpire's chair.
He stayed in the crouching position, roared and pumped his fists, and when he broke serve to lead 3-2 in the third set, it seemed he had turned the match around.
But a double fault on break point allowed Dimitrov to break back for 4-4, and the Bulgarian will have nightmares about the opportunities he let slip away.
First he held a set point on the Nadal serve after the Spaniard shanked a drive volley, but Dimitrov's attempted return shot vertically off his frame.
His big chance arrived in the tie-break. Very uncharacteristically, at 5-4 and serving, Nadal hooked two forehands wide to hand his opponent a set point.
Dimitrov pushed Nadal out of court with his serve but then missed a forehand he really should have made.
One more set point arrived but Nadal saved that one confidently and then took his first chance when Dimitrov pushed another routine forehand wide.
The Bulgarian had to sit and dwell on what might have been while Nadal had his blister retaped, and it was no real surprise when the top seed moved into a 3-0 lead.
Three match points came and went but on the fourth Dimitrov blazed a forehand wide and Nadal was through to his fourth Australian Open semi-final.
The Bulgarian sobbed into his towel before picking up his bags to leave, but better days at grand slams will surely await.