Alexander Zverev served nine double faults in a rollercoaster match, and survived two match points in the third set before ultimately losing in the tiebreaker.
Novak Djokovic will now face either ninth-seeded Italian Fabio Fognini or fifth seed Alexander Zverev.
Alexander Zverev extended his terrible clay-court run, falling 7-5, 7-5 to Italian wild card Matteo Berrettini in the second round.
Rafael Nadal has endured a turbulent few weeks after slipping to defeats in Monte Carlo and Barcelona last month before being hit by a stomach bug on Sunday.
Roger Federer is making his return to clay at the Madrid Open this week after three years' absence.
Rafael Nadal showed no sign of the knee problems and dominated the match completely.
For Rafael Nadal, it's all about his troublesome left knee while for Novak Djokovic, the major goal will be to emerge from a minor slump.
Miami Open: Hsieh Su-Wei battled back from being a set down to beat Naomi Osaka 4-6, 7-6 (7/4), 6-3.
Alexander Zverev crashed out of the ATP Indian Wells Masters after losing to Jan-Lennard Struff, ranked 55th in the world.
Nick Kyrgios defeated three top-10 players on the way to the Acapulco title.
Serena Williams defeated Germany's Tatjana Maria in straight sets to enter the second round at Australian Open.
Roger Federer and Novak Djokovic are both gunning for a record seventh Australian Open crown.
Simona Halep takes the top seeding among the women courtesy of her world number one ranking.
To win the decisive tie-break, a player will need to be the first to 10 with an advantage of at least two points.
Roger Federer will be aiming for a third successive Australian Open.
Roger Federer became the first player to win three Hopman Cups, teaming with Belinda Bencic for the duo's second consecutive title.
World number two Angelique Kerber was too good for the 15th-ranked Barty in the opening match, winning 6-4, 6-4.
Alexander Zverev faltered just once when Novak Djokovic broke him early in the second set but that was the only blemish on an extraordinary performance.