Serving to stay in the set at 5-6, Nadal led 30-0 before striking a doublefault and netting an inside out down the line forehand to reach 30 all.
Nadal then faced setpoint after striking his second doublefault of the game.
A crosscourt backhand hit long from Nadal would end the set.
Shapovalov, who then showed a high fist pump, finished set two with 16 winners.
Nadal broke serve to start set three before Shapovalov leveled the score at two games all.
Nadal around this point in the match appeared to limp at some moments on the court as he appeared to struggle with movement and his ongoing foot injury.
Shapovalov; serving at 40-0, struck an ace to hold serve to lead 3-2.
The Canadian then won the last three games of the match with Nadal committing several unforced errors and doublefaults after two hours and thirty-six minutes of play.
The 23 year old Shapovalov recorded his best grand slam result with his 2021 Wimbledon semifinal finish.
The 35 year old Rafael Nadal has won Roland Garros which begins May 22nd a record 13 times.