Andy Murray saved two match points as he beat Paul-Henri Mathieu 2-6 7-5 6-3 to earn a Miami Masters quarter-final clash against Andy Roddick.
Murray was broken three times in the first set
Murray immediately went 2-0 up but looked sluggish as Frenchman Mathieu, ranked 61 in the world, rattled off six games in a row to take the first set.
And the Scot looked down and out when Mathieu broke at 2-2 in the second set.
But Murray, 19, saved two match points as he battled back to take the second set and cruised through the decider.
Even allowing for the early start and blustery conditions, it was a poor performance in the first half of the match from Murray, who lost the first set in just 29 minutes after 14 unforced errors.
The Scot tried to show more urgency in the second set but it was not until the latter stages of it that he managed to get his game firing.
I was struggling a little bit first thing in the morning. It takes me a little while to warm up
Murray had to save a match point at 4-5 in the second set and then fought off another as Mathieu served for victory.
A resurgent Murray managed to break back and then broke again to take the second set as the Frenchman's serve fell apart.
From then on there was only one winner as belief coursed through Murray while Mathieu's game crumbled.
Twelfth seed Murray went 3-0 up in the final set after winning seven games on the trot.
He let slip three match points as Mathieu served at 2-5 down in the third set but then served out for a place in the quarter-finals.
Murray admitted after the match that he had taken a while to get going after a morning start-time and revealed that spectator abuse had sparked his fightback.
"Someone in the crowd when I was a set and 5-3 down on match point called out 'Murray, you've got nothing' - that kind of spurred me on a little bit and I got a bit fired up after that," he said.
"I wasn't playing great," he added. "I was struggling a little bit first thing in the morning to play solidly and run down all the balls. It takes me a little while to warm up.
"I don't think I would have given up last year, I just wouldn't have found a way to win, and I've done that so far this year.
"I left it a little bit close today to turn it around, but it was one of
those matches where you just had to keep hanging in. It's hard in these conditions.
"I felt like the most important thing was that I won the match, and that's what I can take away from it because I didn't feel like I did anything that well."
The teenager will play Roddick in the last eight after the American third seed beat David Ferrer of Spain 7-5 6-3.
"Obviously, Roddick, we've had some tight matches. It's been 3-2 to me I think," said Murray.