(CNN) -- World number one Rafael Nadal overcame an injury scare to win a four-set classic over Juan Martin Del Potro and claim a place in the last eight at Wimbledon.
With the light fading on Centre Court and Prince William and Catherine, Duchess of Cambridge watching on, Nadal eventually beat his Argentine opponent 7-6 3-6 7-6 6-4 in just under four hours to book a quarterfinal berth.
Nadal called for the doctor at the end of the first set after suffering an injury to his left foot that impeded his movement but he battled through the pain to take the opener on a tie-break.
However, as Nadal moved gingerly around the court in the second set, Del Potro took full advantage to level the match thanks to some booming ground strokes.
In the third set Del Potro, the 2009 U.S. Open champion, fell awkwardly when trying to change direction on the baseline and he left the court to be seen by the doctor.
The 22-year-old returned and ensured the third set went into a tie-break but made a series of unforced errors to hand his Spanish opponent the upper hand before Nadal powered to victory in the fourth.
After the match Nadal told reporters: "I don't know what the problem is, it seems to be a problem with the bone in the foot.
"I thought I would have to retire at the end of the first set because there was a lot of pain. But the tape changed the situation. Now I will have to check with the doctors and the physios. Something is there."
Nadal will play 10th seed Mardy Fish in the last eight after the American battled past sixth seed and last year's runner-up Tomas Berdych 7-6 6-4 6-4.
World number two Novak Djokovic eased into the quarterfinals with a straight sets win over Michael Llodra.
The Serbian, seeded second, powered to a 6-3 6-3 6-3 victory over the 19th seed in just an hour and 40 minutes on Court No. 1.
He will now face qualifier Bernard Tomic after the 18-year-old Australian continued his dream run at the tournament by defeating Belgium's Xavier Malisse 6-1 7-5 6-4.
Tomic, who was born in Germany, is the youngest Wimbledon quarterfinalist since former champion Boris Becker in 1986.
Britain's number four seed Andy Murray enjoyed a comfortable passage into the last eight with a 7-6 (7-3) 6-3 6-2 victory over France's Richard Gasquet.
He had been surprised to see William and Kate in the Royal Box on Centre Court and joked to reporters afterwards he would have liked advance warning.
He said: "If I'd known they were coming, I would have shaved. I was thinking to myself as I came off I was sweaty and very hairy. I said to them, 'I'm sorry, I'm a bit sweaty.'
"No-one else had heard anything. I saw them when I went out. It's obviously great to get the chance to play in front of them and it was very nice to get to meet them."
Murray will now play Spain's Feliciano Lopez after he beat another unseeded player, Lukasz Kubot from Poland, 3-6 6-7 7-6 7-6 7-5.
Six-time Wimbledon champion Roger Federer dropped the first set against Russian 18th seed Mikhail Youzhny but recovered to triumph 6-7 6-3 6-3 6-3.
The Swiss will now face France's Jo-Wilfried Tsonga who overcame seventh seed David Ferrer 6-3 6-4 7-6.