Andy Murray was frustrated but relieved after scrapping his way past Jiri Vesely to reach the fourth round of the BNP Paribas Open.
Indian Wells has been a tricky venue for the Wimbledon champion in the past and there was nothing pretty or convincing about his 6-7 (2/7) 6-4 6-4 victory.
It all looked so different when he raced through the first three games, two of them on 20-year-old Vesely's serve.
But Murray lost his way, the Czech relaxed into the match, and a bit more experience would surely have seen him claim victory.
Vesely, playing in his first Masters series event, twice led by a break of serve in the second and third sets but tightened up at the crucial moments and Murray snuck through after two hours and 47 minutes.
The Scot said: "It was a frustrating match. Whether it was the beginning or the end, it was that sort of match where at no stage did either of us play well at the same time.
"I started the match well, he started off the match badly. He missed a lot of easy shots, and then he started playing consistent, not making errors, and I started missing.
"That can create a lot of breaks and a lot of back-and-forth swings. The whole match was frustrating.
"The most important thing today was that I won. I could have lost the match and you don't get an opportunity until Miami to play better or to improve some things.
"It's good to have the chance to play another match here and hopefully put in a better performance."
Vesely, who was beaten by Britain's Oli Golding in the final of the US Open juniors in 2011, is the youngest man in the top 100, and to start with he could not keep the ball in the court.
But Murray let him into the match with a sloppy service game at 3-0 and from then on it got very complicated for the fifth seed
He served for the first set but was broken after Vesely correctly challenged an overrule, and the Czech was much the better in the tie-break, although he got away with leaning over the net to play one shot.
Another woeful game from Murray gave Vesely a break at the start of the second but in the latter stages of it nerves took hold and he dropped serve three times in a row.
Double faults and smashes were his Achilles heel - so poor was his overhead that he raised his arms in the air to huge cheers from the crowd when he finally connected properly with one.
Against Lukas Rosol in his first match, Murray had pulled away convincingly after winning the second set but he dropped serve twice at the start of the third here and needed more generosity from his opponent to get back on terms at 4-4.
Murray moved ahead at 5-4 for the first time since the opening set and then broke a cramping Vesely to clinch victory on his third match point.
It was the fourth time in his last five victories that Murray has recovered from a set down, something he has made a habit of throughout his career.
He said: "I always try to find a way to come back. I have had a good record of that since I came on the tour.
"I don't know exactly why that is. My mum or parents or whoever watched me play when I was young, always said I found ways to win matches even when I was losing or looked like I was going to lose the match.
"It's a good habit to have."
In the fourth round Murray will play Canadian 10th seed Milos Raonic, who was a 6-4 6-3 winner over Alejandro Falla.