Nadal's stunning 6-3, 6-4, 3-6, 4-6, 15-13 defeat came after defending champion Andy Murray and seven-time winner Roger Federer had cruised into the last-eight in straight sets.
The four hour and 48-minute stunner on Court One had the knock-on effect of pushing Novak Djokovic's last-16 clash against France's Adrian Mannarino back to tomorrow.
Djokovic had been the last match scheduled on the court but officials chose to postpone the tie instead of shifting it to Centre Court where it could, if necessary, have been completed under lights.
"It was not my best match against a very uncomfortable opponent," said world number two Nadal, the 2008 and 2010 champion.
More From This Section
"Well done to him. He played great, especially in the fifth set but I fought to the last ball."
- Muller tired but thrilled -
=============================
Nadal converted just two of 16 break points, while Muller fired 30 aces and 95 winners.
Muller, seeded 16th, will make his first Wimbledon quarter-final appearance against former US Open champion Marin Cilic on Wednesday.
In a pulsating final set, which stretched to 95 minutes, Nadal saved two match points in the 10th game and two more in the 20th.
In between, Muller had to fight off a break point in the 13th game and four more in the 19th.
Nadal was always chasing the score and he finally cracked in the 28th game of the decider when he went long with a return.
- Murray through -
==================
Defending champion Murray reached a 10th successive Wimbledon quarter-final with a 7-6 (7/1), 6-4, 6-4 win over France's Benoit Paire.
World number one Murray will face Sam Querrey for a place in the semi-finals.
"I thought I played well. Maybe a couple of sloppy service games in the first set but that was by far the best I'd hit the ball so far in the tournament. So I'm really pleased with that," said Murray.
Murray's win meant that with Johanna Konta also making the last-eight in the women's tournament, it is the first time since 1973 that Britain has two players in the quarter-finals.
Federer reached his 50th Grand Slam quarter-final and 15th at Wimbledon with a 6-4, 6-2, 6-4 win over Grigor Dimitrov.
The Swiss star will now face Milos Raonic, the 2016 runner-up, after the sixth-seeded Canadian clinched a 4-6, 7- 5, 4-6, 7-5, 6-1 win over Alexander Zverev of Germany, the 10th seed.
Raonic defeated Federer in the semi-finals at Wimbledon in 2016.
"I'm thrilled to be back in the quarters again," said Federer who took his record over Dimitrov to 6-0.
- Safety issue -
================
The All England Club defended the decision not to switch Djokovic against Mannarino to Centre Court.
"It was determined the match could not be moved to Centre Court due to the number of spectators remaining in the grounds," said a statement.
"As late as 8:30pm, 30,000 people still remained in the grounds, and therefore moving the match would have created a significant safety issue.
Querrey, the US 24th seed who knocked out Djokovic in 2016, made the quarter-finals for a second successive year with a 5-7, 7-6 (7/5), 6-3, 6-7 (13/11), 6-3 over unseeded Kevin Anderson of South Africa.
Seventh seeded Cilic downed Roberto Bautista Agut of Spain 6-2, 6-2, 6-2.
Cilic will look to reach his first semi-final at the All England Club when he faces Muller.
Czech 11th seed Tomas Berdych downed eighth-seeded Dominic Thiem of Austria 6-3, 6-7 (1/7), 6-3, 3-6, 6-3.
Berdych, the 2010 runner-up, will face either three-time champion Djokovic or Mannarino for a place in the semi-finals.