After delivering an error-ridden performance during his first-round win over Jack Draper on Monday, Nadal was never really at the races against McDonald as the American dominated from start to finish.
The Spaniard was never comfortable and the world No 65 took full advantage as he won 6-4, 6-4, 7-5 in a match that lasted just under two-and-a-half hours under the roof of the Rod Laver Arena.
McDonald, though, deserves a lot of credit as Nadal didn't appear to be troubled by injury early on and the American broke in the opening game of the match and backed it up with a second break in game, although the tennis great did get one break back.
The top seed was certainly up against it and he felt the world was against him as he also raged to the chair umpire over being rushed.
The second set had a similar theme as McDonald again broke in the first game, but the 22-time Grand Slam winner was level on serve in game four only for the American to edge ahead again in game seven.
By then it was clear that the former world No 1 was struggling and he took a medical timeout at 3-5 down as he struggled with a hip problem. As he left the court, the camera panned to his box and his wife Mery Perello wiped away tears while his coach Carlos Moya was pretty downbeat.
Nadal returned, but he faced an uphill task and was still in discomfort as McDonald wrapped up the second set.
The 36-year-old played the third set at walking pace, but he initially held firm as he saved a break point in game nine. However, McDonald seized an opportunity in game 11 and then served it out in the next game for the biggest win of his career.
"I'm really happy with that match," said McDonald.
"I was playing really well, serving great, returning well too so I was really taking it to him. It was really tough to stay mentally engaged a little bit, but I found a way to pull it off so I am really happy."