World number 204 Valentin Vacherot on Sunday beat his cousin Arthur Rinderknech to win the Shanghai Masters 4-6, 6-3, 6-3 and become the lowest-ranked champion in the history of ATP 1000 events.
Djokovic took medical timeouts during both sets.
Novak Djokovic will return to action in Shanghai next month in his first tournament since his US Open semifinal defeat by Carlos Alcaraz, organisers of the Masters tournament said.
Novak Djokovic insisted Sunday that he plans "to compete and play next season" despite suffering another loss at the hands of world number one Jannik Sinner.
World number one Jannik Sinner defeated 24-time Grand Slam champion Novak Djokovic 7-6 (7/4), 6-3 on Sunday to win the Shanghai Masters.
Jannik Sinner beat Tomas Machac 6-4, 7-5 to reach the Shanghai Masters final on Saturday and ensure he finishes the year as world number one.
Australia's Nick Kyrgios is booed off court in a tanking row at the Shanghai Masters as Rafael Nadal crashes out and Andy Murray motors into round three.
Australia's Nick Kyrgios is booed off court in a tanking row at the Shanghai Masters as Rafael Nadal crashes out and Andy Murray motors into round three.