Top seed Stan Wawrinka crashed out of the Miami Open, falling 4-6, 6-2, 6-1 to German young gun Alexander Zverev.

Zverev's win earned him his first place in a Masters 1000 quarter-final and he will face the winner of Tuesday's late game between Australian Nick Kyrgios and Belgian David Goffin.

Roger Federer, Rafael Nadal and Kei Nishikori advanced to the quarter-finals on cue.

Swiss Wawrinka, beaten by Federer in the final of Indian Wells earlier in March, looked weary as he struggled through the third set of his match.

"I had one bad game to start the second set and then it was tough for me," Wawrinka, the reigning US Open champion, said. "I don't know. I completely went down physically and mentally, and also my tennis was completely out. I had no more gas."

"For sure it's a disappointing match. I think the level was quite up and down. We were both fighting a little bit in the first set to find good level. It was really humid, not easy to play some great tennis," he added.

Federer had to work hard for his victory against 14th seed Roberto Bautista Agut, emerging with a 7-6 (7/5) 7-6(7/4) win setting up a last eight meeting with Czech Tomas Berdych, the 10th seed, a 6-3, 7-5 winner over France's Adrian Mannarino.

"It was a different kind of match," said Federer, who is in an excellent run of form having won the Australian Open and Indian Wells already in an amazing 2017.

"It wasn't the big-serving match where you're only going to see so many looks, you know, so when you miss chances you always feel a bit frustrated sometimes.

"That's where you got to keep a positive mindset and make the right plays," he added.

The first set was a close and entertaining battle.

Bautista broke to go 5-4 up but Federer then won every point in the next two games. The tie-break saw some fantastic tennis from both players but the Swiss delivered at the close.

"I thought Roberto did a good job of making shots, staying offensive when he could, fending off a lot of good shots that I hit," Federer said. "Then it was tough. The sun was coming from the side in the beginning so it's hard to chase the lines.

"At the end I'm very happy and pleased that I got it done in straight sets," he said.

Nadal beat France's Nicolas Mahut 6-4, 7-6 (7/4) in a tightly fought contest and will face American Jack Sock who comfortably beat his compatriot Jared Donaldson 6-2, 6-1.

The Spaniard, who has never won the Miami title, got the only break of the match to go 5-4 up in the first set and said he expected a strong challenge from Sock.

"He's a very aggressive player, very powerful player, big serve, big forehand, and a good backhand too. He plays quick with his backhand.

"So I need to play aggressive. That's the only way. If I let him play in a comfortable position going to be impossible for me. So I need focus with my serve, but at the same time I need to be aggressive," said Nadal.

Sock is bubbling with confidence however.

"I'll definitely give myself a lot more chance to win this time around than maybe I did a few years ago. I'm 24 years old now and been on tour for a while. I'm playing these matches and hoping I can win and going in believing I can win for sure," said the American.

Second-seed Nishikori, of Japan, survived a second set scare against Argentine Federico del Bonis en route to a 6-3, 4-6, 6-3.

Nishikori, who lost to Novak Djokovic in last year's Miami final, will face Italian Fabio Fognini who defeated American Donald Young 6-0 6-4.