World number one Rafa Nadal saved five match points before beating David Nalbandian 3-6 7-6 6-0 in a classic fourth-round encounter at Indian Wells.
In a match which finished past 2 am, Argentine Nalbandian had four match points at 5-3 in the second set and another on his own serve at 5-4.
But Nadal showed amazing resilience to break back and then snatch the set on a tie-break, before ripping through the decider for his first win over Nalbandian in three attempts.
The top seed will now meet another Argentine, Juan Martin Del Potro, for a place in the last four.
Roger Federer also battled into the quarter-finals with a 6-3 5-7 6-2 victory over Fernando Gonzalez of Chile.
The world number two raised his game when he needed to as he came through his first real test of the week, setting up a clash with 10th seed Fernando Verdasco.
Defending champion Novak Djokovic came through another tight encounter, beating Swiss Stanislas Wawrinka 7-6 7-6.
"I enjoy playing Fernando because it's so tactical," Federer said. "But then at the same time it's so brutal, so aggressive. You think you have a slight chance to win the point, and then you realise, no, there's actually none."
Federer cruised through the first set but Gonzalez, unleashing a series of spectacular forehand winners, broke in the 12th game of the second set to force a decider.
Federer then hit another gear, breaking in the third game of the third set and then again in the seventh before serving out for victory.
The Swiss has won both his previous matches with Verdasco, but the Spaniard looked in good form in beating Philipp Kohlschreiber of Germany 6-4 3-6 6-1.
"I'm looking forward to playing more baseline rallies against Verdasco," Federer said.
"I'm sure that's going to happen. It's a good thing that I'm still in the tournament and facing an opponent who actually is going to extend the rallies a little bit. It's going to be a nice match, I'm sure."
Wawrinka had a set-point in the second set that would have taken his match to a decider, but third seed Djokovic saved it and now plays Andy Roddick, who battled past Spain's David Ferrer 7-6 3-6 6-3.
Croat Ivan Ljubicic saved five match points before beating Russian Igor Andreev 4-6 7-6 7-6, and will now face fourth seed Andy Murray, who progressed when Tommy Robredo retired with a wrist injury
Quarter final
Mar 19
Time Match
21:00 Ljubicic I. v Murray A.
03:30 Verdasco F. v Federer R.