David Ferrer also advanced on Centre Court, where organizers again came under scrutiny for their use of the retractable roof. Their decision to open and then close it caused the start of his match against Juan Martin del Potro to be delayed by about 40 minutes.
Murray made the last eight for the fifth straight year by beating the 16th-seeded Marin Cilic 7-5, 6-2, 6-3, while Mayer ousted Richard Gasquet of France 6-3, 6-1, 3-6, 6-2. American qualifier Brian Baker's remarkable run ended with a 6-1, 7-6 (4), 6-3 loss to 27th-seeded Philipp Kohlschreiber of Germany.
Kohlschreiber advanced to his first ever quarterfinal appearance in his 33rd Grand Slam. Only three men in the Open Era appeared in more Grand Slams before advancing to their first quarterfinal (Fabrice Santoro 54, Mark Woodforde 38, Todd Woodbridge 34).
Rain had prevented five of the men's fourth-round matches from being completed Monday. The weather continued to cause headaches as the start of play on outside courts was delayed about 30 minutes because of light showers. When matches started, they were quickly halted again for another rain delay of about an hour.
"We stopped obviously a lot," Murray said. "You're always a little bit edgy when you come out after a rain delay when you have the momentum with you. You stop, and then you come back out, and it feels a bit like you start from scratch again. I needed to serve well today and I got a lot of free points that helped me out."
Play on Centre Court didn't even have time to start at all before the rain came. Organizers had closed the roof because of earlier showers in the morning but then decided to open it during a dry spell just before Ferrer's match against del Potro was to start. When the showers then resumed, they promptly had to close it again and keep the players waiting.
When the match began, Ferrer needed less than two hours to beat del Potro 6-3, 6-2, 6-3. Another rain delay then forced the suspension of Jo-Wilfried Tsonga's match against Mardy Fish, with the fifth-seeded Frenchman leading.
When play resumed, Tsonga overcame an ailing back, a one-set deficit and several delays to beat Fish 4-6, 7-6 (4), 6-4, 6-4 and reach the quarterfinals.
Tsonga lost the first set before the match was suspended on Monday, and it was halted twice more because of rain after it was resumed -- the last time with the fifth-seeded Frenchman leading 4-2 in the fourth set.
Tsonga left the court briefly after the second set to get treatment on his back, but returned to break Fish in the next game. He was in firm control after that, and served out the match with an ace.
"I went to bed last night, and I thought I could maybe win the tournament, the way I was playing," said Fish.
Fish was playing in his first tournament since having a procedure on his heart in late May and was trying to reach the Wimbledon quarterfinals for the second year in a row.
"My body doesn't turn up as good if you stop and start like that," said Fish, who was playing in his first tournament since having a procedure on his heart in late May.
Murray's match was halted Monday with the Briton leading 40-0 at 3-1 in the second set on Monday. He had time to play one point on Court 1 -- clinching that game -- before rain started falling again. One game later, the match was suspended once more. After the second resumption, there was another slight break early in the third set as the players remained in their chairs for about five minutes under umbrellas as officials waited for a light shower to subside.
"In matches, you can build momentum and build leads, and then when you stop, once you come back out again, you feel like you're starting off from square one," Murray said. "There were, what, three or four stops? It's not easy."
The Briton's victory never looked in doubt, though, and he served out the match to love when the Croat netted a backhand.
"If I serve like I did at the end of the second set and the third set today, it doesn't matter how well someone's returning," Murray said.
When Cilic slammed a backhand into the net on the first match point, Murray raised his fingers and head to an overcast sky, in what is becoming his trademark celebration. He's not getting carried away by the so-called "Murray Mania," despite being another step closer to becoming the first British winner of the men's singles here since Fred Perry in 1936.
"I've thought about (winning Wimbledon) in the past, but during this tournament it's not something I've been thinking about," said Murray, who reached the Wimbledon quarterfinals for the fifth straight year. He lost in the semifinals in the last three.
Next up is Ferrer, who beat Murray in four sets in the French Open quarterfinals last month.
"Very difficult to beat Andy on all surfaces but on grass court it's more difficult," said Ferrer, who beat Andy Roddick in the third round. "He's the favorite because he's better than me ... I will have to play my best tennis to beat him."
The 126th-ranked Baker was trying to become the third American qualifier to reach the quarterfinals at the All England Club. He was playing in Wimbledon's main draw for the first time after being off the tour for more than five years because of a series of operations, one on his right elbow. He was ranked 458th at the start of 2012 but now will rise inside the top 100.
"It's been an unbelievable run," Baker said. "Can't be too upset about that, even though as a competitor (I'm) definitely pretty frustrated right now. ... Hopefully I'll learn from it and have more opportunities."
Djokovic will be Mayer's next opponent.
"I can play everything. I can play serve-and-volley. I can play drop shots. I can play with slice. I can play fast. So I will try to irritate him, maybe, a little bit," Mayer said of his quarterfinal opponent. "You never know in tennis. Everything is possible."
Information from The Associated Press contributed to this report.