Rafael Nadal was pushed all the way by Grigor Dimitrov but eventually prevailed in three sets to remain on course for a ninth title at the Monte Carlo Masters.
The Spaniard, ranked three this year, appeared poised for a comfortable passage to the semi-finals as he swept through the first set, breaking his opponent on three occasions.
But Dimitrov refused to be bowed and responded with some sensational tennis to take control of the second set, eventually securing it with a second break of serve when Nadal netted a forehand.
It was only the third set of tennis Nadal had dropped at the tournament over the past six years, but Dimitrov was not ready to sit back and admire his achievement as he continued to go toe-to-toe with his rival in the decider.
The Bulgarian produced an array of dazzling groundstrokes but was unable to shake off Nadal and in the end the Spaniard's superior conditioning told as a tiring Dimitrov netted a backhand, allowing his opponent a crucial break to move 5-4 ahead.
Dimitrov still had one moment of brilliant defiance left as he fired a spectacular forehand winner down the line to fend off a first match point, but Nadal was not to be denied and eventually got the job done with an ace to clinch a memorable 6-2 2-6 6-4 triumph.
Tsonga sees offf Wawrinka
Nadal will now face Jo-Wilfried Tsonga after the Frenchman booked his place in the semi-finals by coming from a set down to beat Stansilas Wawrinka.
Wawrinka had been in scintillating form as he beat Andy Murray for the loss of just three games on Thursday and started in similarly strong fashion as he comfortably took the opening set.
But Tsonga refocused and, having adopted a more attacking gameplan, began to wear down his opponent with his booming forehand proving increasingly influential.
Having levelled the contest, he then got his nose in front in the decider as he broke to lead 4-3 after a fine forehand winner down the line.
Wawrinka fought bravely to fend off three match points on his own serve, but it merely delayed the inevitable as Tsonga served out in the next to close out a 2-6 6-3 6-4 victory in a little over two hours.