'King of Clay' Nadal fell to a 1-6 7-5 6-2 defeat to Shapovalov in the third round in Rome, with the Canadian surging to victory after winning 12 straight points from 2-2 in the deciding set.
The legendary Spaniard stormed through the first set thanks to a series of brilliant returns, but his opponent dominated at the net in the second to take the match the distance.
Shapovalov then flipped the narrative on its head by winning 14 of a possible 22 return points to set up a quarter-final meeting with Casper Ruud, who beat Jenson Brooksby 6-3 6-4.
Djokovic is one win away from retaining his status as world number one after taking just 75 minutes to see off three-time grand slam winner Stan Wawrinka 6-2 6-2.
After a lengthy spell out injured, Wawrinka ended a 15-month wait for an ATP Tour victory at Foro Italico before the Serbian brought his run to an end.
"It is great to see Stan back and winning. He won two tough matches. You can see he is still not physically where he wants to be. But, nevertheless, he is Stan Wawrinka and he can hurt you if you give him time," Djokovic said.
"I managed to do well from the beginning. I really moved him around the court and held my serve comfortably except for that loss of my serve in the second set."
Felix Auger-Aliassime stands between Djokovic and the number one spot after overcoming lucky loser Marcos Giron 6-3 6-2.
In the other half of the draw, Stefanos Tsitsipas and Jannik Sinner will play out an entertaining quarter-final after they beat Karen Khachanov and Filip Krajinovic respectively.
Alexander Zverev, the defeated finalist in Madrid last week, beat Alex De Minaur 6-3 7-6 (7-5) and will battle Cristian Garin for a place in the final four.