After winning the first two sets, Muller staved off a furious comeback from Nadal to reach the Wimbledon quarterfinals in a match that lasted nearly five hours.
"I'm tired," Muller said. "It was a long match. I was two sets up -- I played really well in the first two sets -- and then Rafa stepped it up, and then at the end it was just a big battle."
Muller won 6-3, 6-4, 3-6, 4-6, 15-13 to advance to a Grand Slam quarterfinal for the second time in his career and the first time since the 2008 US Open.
"To be honest, I haven't really realized what just happened," he said. "It's a great feeling. ... I'm just glad it's over and I'm in the quarterfinals now."
Muller was asked what it felt like to have the crowd firmly behind Nadal during the match.
"Well, I mean, it's kind of what you get when you play Rafa, Roger, Andy, Novak. They're always the crowd's favorite," he said.
"I didn't feel sorry, to be honest. I didn't feel like I had to apologize. Yeah, I mean, there's obviously a lot of emotions at the end. I felt like the crowd also cheered for me at the end of the match. So it was a nice moment."
Nadal, the reigning French Open champion, has not been to the Wimbledon quarterfinals since 2011. He missed this grasscourt Grand Slam last year because of a wrist injury.
The match lasted 4 hours, 48 minutes.
"Well, he played well," Nadal said. "I think I didn't play my best the first two sets. I make a couple mistakes that make me then play all the time against the score. And that's so difficult against a player like him.
"So well done for him. He played well. Especially in the fifth, he played great game. I was there, fighted until the last ball, with the right attitude. Probably was not my best match, but at the same time I played against a very uncomfortable opponent."
Muller's quarterfinal opponent will be seventh-seeded Marin Cilic, who beat Roberto Bautista Agut 6-2, 6-2, 6-2. Cilic, who won the US Open in 2014, will be playing the quarterfinals at the All England Club for the fourth straight year.
"I probably won't feel great tomorrow," Muller said. "But I'm pretty confident that I will be in good shape for Wednesday. I mean, I have a day off tomorrow. I'm going to get some treatment."
Federer, a seven-time champion at the All England Club and one of the fan favorites, reached the quarterfinals here for the 15th time in his career. He advanced to the quarterfinals for the 15th time by beating Grigor Dimitrov 6-4, 6-2, 6-4.
"I didn't expect it to go that easy," said Federer, the Australian Open champion. "It wasn't as easy maybe as it looks like."
In the previous round, Querrey beat 12th-seeded Jo-Wilfried Tsonga in five sets. That match was suspended because of darkness with Querrey leading 6-5 in the fifth set, and Querrey needed only four minutes to win when it resumed a day later.
Querrey has not been past the quarterfinals, which he reached only once, in his previous 41 appearances in the main draw of a Grand Slam.
Anderson, who tied Querrey with 31 aces, reached the fourth round at the French Open in June and had twice previously reached the fourth round at Wimbledon.
The Associated Press contributed to this report.