Second seed Novak Djokovic saved three match points before scraping past Germany's Philipp Kohlschreiber 6-3, 2-6, 7-6 in the third round of the Indian Wells ATP tournament on Monday.
Trailing 4-5 and 0-40, Djokovic took advantage of a spate of unforced errors by his opponent to claw back from the brink of defeat at the Indian Wells Tennis Garden.
The world number two, champion here in 2008, won that game when Kohlschreiber netted a forehand and he went on to clinch the tiebreak 7-3 as the German's resistance crumbled.
The Serb will next meet 20th-seeded Croat Ivan Ljubicic, who beat Argentine qualifier Brian Dabul 6-2, 6-3 .
After Djokovic battled though in just over two-and-a-half hours on the stadium court, twice champion Rafael Nadal of Spain eased home with a 6-2, 6-2 demolition of Croat Mario Ancic.
Nadal, who beat Britain's Andy Murray in last year's final, broke Ancic twice in each set.
Djokovic, who appeared to be in total control after sweeping through the opening set against Kohlschreiber and leading 2-0 in the second, let out a loud yell of relief after sealing victory with a forehand winner.
"Fighting through, it's another win so I try to look on the positive side, the things I did well," the 22-year-old told reporters.
"I am still trying to find rhythm, to feel good on the court. For the next match, I want to maintain focus right up to the end and not have any mental breakdowns in the middle."
Kohlschreiber, who beat Djokovic in straight sets when the pair last met at the 2009 French Open, took the second set after winning six games in a row on a sun-splashed afternoon in the California desert.
He went on to break Djokovic in the second game of the third set and immediately held serve to lead 3-0.
In a match of bizarre momentum shifts, the Serb saved two break points in the next game and broke his opponent in the fifth and seventh to lead 4-3 before he lost serve in the eighth.
Djokovic appeared to be on his way out when he hit a forehand long to trail 0-40 in the 10th game but he won the next three points courtesy of a forehand smash at the net and successive backhand errors by Kohlschreiber.
He managed to hold serve and maintained winning momentum after the wildly fluctuating set went into a tiebreak.
"I served more efficiently and managed to have more (aggression) in the play and take over control of the point," Djokovic said of his fightback in the 10th game.
"I just don't understand why I didn't do that throughout the whole match. I changed the tactics for no reason."
Earlier on Monday, 21st seed Juan Monaco of Argentina upset 11th-seeded Spaniard Juan Carlos Ferrero 7-6, 3-6, 6-3 in three hours and one minute, the longest match this week.