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.