Andy Murray survived a scare to beat Czech youngster Jiri Vesely 6-7 (2-7) 6-4 6-4 in the third round of the BNP Paribas Open at Indian Wells.
The British number one battled back from a set and a break down to level against the 20-year-old.
Vesely, ranked a career-high 77, then led 4-2 in the decider before Murray showed his experience to reel off four straight games.
Murray will play 10th seed Milos Raonic in the next round.
"It was a poor match, so many breaks of serve," Murray told BBC Sport. "I was up a double break in the first set and didn't get it, which is obviously disappointing.
"I basically just had to try and find a way to win the match in the end because the quality and the rhythm of the match was not really there from start to finish.
"The best way of building confidence really is by winning matches when you aren't playing well."
Murray has never won the Indian Wells tournament, although he reached the 2009 final, when he lost to Spain's Rafael Nadal.
He made a bright start in his first meeting with the left-handed Vesely, but was forced into a tie-break, which the Czech won amid some controversy.
Vesely should have lost a point when he put his racquet over Murray's side of the net, but umpire Mohamed Lahyani did not see it.
"It's tough for the umpire to obviously call it," added Murray. "He'd also made a few bad overrules in my favour just before that, so it would have been a tough one to call.
"That's never happened to me, I don't think, on the tour ever."
In an error-strewn display, Murray twice had to come back from a break down to take the second set.
Both players required treatment to blisters on their feet and neither found their rhythm in an untidy decider.
But Murray's will to win shone through when he responded to falling two games behind with back-to-back breaks to win the match.
Murray, who also fought back from a set and a break down to beat Lukas Rosol in the previous round, was joined in the last 16 by four-time winner Roger Federer, with the Swiss overcoming Dmitry Tursunov of Russia 7-6 (9-7) 7-6 (7-2).
Fellow Swiss and Australian Open winner Stanislas Wawrinka breezed past Italy's Andreas Seppi 6-0, 6-2.
However, top seed and defending champion Rafael Nadal lost 6-3 3-6 7-6 to Ukrainian Alexandr Dolgopolov.
Raonic, of Canada, beat unseeded Colombian Alejandro Falla 6-4 6-3.
Defending women's champion Maria Sharapova also crashed out of the tournament, losing 6-3 4-6 7-5 to Italian qualifier Camila Giorgi.
Top seed Li Na was a 6-3 6-4 winner over Czech Karolina Pliskova.
Meanwhile, British pair Colin Fleming and Ross Hutchins were beaten 3-6 6-4 10-6 in the second round of the doubles by third seeds Ivan Dodig and Marcelo Melo.
The deciding set went to a champions tie-break, with the winner the first to 10 points.
There was better news for fellow Brit Dominic Inglot as he and partner Treat Huey of the Philippines defeated Spain's David Marrero and Fernando Verdasco 3-6 6-3 10-7.