Bulgarian Grigor Dimitrov flirted with a massive upset before Rafael Nadal managed to restore normal service as the Spaniard earned a tight 6-2, 2-6, 6-4 win in the quarter-finals of the Monte Carlo Masters on Friday.
Nadal, bidding for an unprecedented ninth straight trophy at an event which he has dominated, was given a huge fright by Dimitrov, who fell victim to leg cramp in the closing moments of a thriller lasting just over two hours.
One of the closest calls of Nadal's clay career ended as the Spaniard won his 45th straight Monte Carlo match. He lost a set here for only the third time since 2009.
Dimitrov, feeling his left thigh, managed to save a Nadal match point with a rifling winner down the line which left him doubled over in pain.
A few moments later, Nadal fired over his second ace of a dramatic afternoon to take the win.
Nadal, whose only loss here came back in 2003, produced some 36 unforced errors while the 34th-ranked Dimitrov struck 28 winners.
Third seed Nadal will now have to prepare for a semi-final against confident Frenchman Jo-Wilfried Tsonga, who earlier advanced against Stanislas Wawrinka, winning 2-6, 6-3, 6-4.
Wawrinka, the 13th seed, saved four match points -- three on his own serve in the penultimate game -- before Tsonga bulldozed to victory in just over two hours on the clay.
Tsonga ended with his sixth ace in a match where he fended off 10 Wawrinka break points from 12 chances for the Swiss.
And he will now gather his strength for his match on Saturday against Nadal.
"It's an incredible challenge, he's won eight times here. Anything I might achieve will be just a bonus for me," said Tsonga.
"I have no longer any pain in my legs because I know I'm going to play a player that's a lot better than I am on clay.
"I do have some weapons, I have everything to win and nothing to lose."
Tsonga is one of two French players still in contention, with seventh seed and 2005 semi-finalist Richard Gasquet playing later against Italian Fabio Fognini.
Wawrinka, who eliminated second seed Andy Murray on Thursday, swept the first set in 42 minutes but found his progress slowed in the second as the burly Tsonga began to discover his deadly range.
The French seed broke twice in the second to level at a set apiece.
He went up a break in the third 4-3 but had to battle through Wawrinka's last stand before winning on his fourth match point.