(CNN) -- Top seed Rafael Nadal had to save five match points before beating Argentina's David Nalbandian 3-6 7-6 6-0 to reach the quarterfinals of the Masters Series tournament at Indian Wells.
Nadal had to be at his fighting best to survive a late night scare against Nalbandian.
The fourth round match in California finished at 2 am local time on Thursday morning with world number one Nadal racing through the decider after surviving the scares in the second set.
Nalbandian had not dropped a set against Nadal in their previous two matches and made a confident start as he took the opener.
After breaking to take a 3-2 lead in the second set, he had four match points on the Spaniard's serve in the ninth game and then a further chance as he tried to serve out at 5-4.
But Nadal showed typical resilience and after saving the final match point converted on his eighth break point of a thrilling set to level at 5-5.
Nadal quickly took control of the tiebreak to even it up was always on top in the third set as Nalbandian wilted, dropping his service three times. The Spaniard will now play another Argentine, sixth seed Juan Martin del Potro, who beat American wild card John Isner 7-6 7-6.
All the other favorites also made the quarterfinals in earlier last 16 matches with world number two Roger Federer surviving the loss of the second set to see off Chilean Fernando Gonzalez 6-3 5-7 6-2.
Federer was winning for the 12th time in 13 matches against Gonzalez to earn a clash with Fernando Verdasco of Spain.
Verdasco, playing his first match since reaching the semifinals of the Australian Open, beat German Phillipp Kohlschreiber 6-4 3-6 6-1.
He has been struggling with an ankle injury since his Melbourne heroics but is looking forward to playing the Swiss maestro.
"So now that I won three matches already, I'm in quarterfinals," he told the official ATP Tour Web site www.atpworldtour.com.
"I did all the good things that I supposed to do. Now with Federer I will try to do a great match. I don't have anything to lose."
World number four Andy Murray also made it through to the quarterfinals as his Spanish opponent Tommy Robredo retired with a wrist injury when trailing 6-2 3-0 to the British number one.
Murray next faces Croatian Ivan Ljubicic, who beat Russian Igor Andreev 4-6, 7-6 7-6 in a marathon fourth round match lasting more than three hours.
Defending champion Novak Djokovic and home hope Andy Roddick will meet in the last eight after hard-fought fourth round wins.
World number three Djokovic beat Stanislav Warwrinka of Switzerland on two tiebreakers 7-6 7-6 after both men held advantages in either set only to be pulled back.
"It was a really big challenge coming back in the second set and winning the two tie-breakers against a tough opponent was a really good struggle and good fight," said Djokovic.
Roddick snapped a three-match losing streak against 12th-seeded Spaniard David Ferrer.
The seventh seed broke Ferrer early in the deciding third set to secure a 7-6 3-6 6-3 victory in two hours and 19 minutes.