Hurkacz, the 2023 Shanghai champion and world number 34, beat Djokovic 6-4, 6-3 in the second round as the 39-year-old faltered against his big-serving opponent a decade his junior.
The former world number one turned in a disappointing performance just three days after claiming the 102nd professional title of his career in Beijing, where he has never lost a match.
It was Hurkacz's first victory against the Serbian veteran in nine meetings, and he sent down 13 aces across the one-hour-and-28-minute encounter.
Djokovic, who has struggled for fitness in recent months, hunched over and squatted down between points on a cool Shanghai evening while his opponent sprinted across the court.
Djokovic double-faulted in the fourth game of the second set to give Hurkacz a 3-1 lead, and the Pole held serve through his win.
Hurkacz will face either Italy's Lorenzo Musetti or Chinese wildcard Zhou Yi in the third round.
