An inspired Stefanos Tsitsipas came from a set down to end Novak Djokovic's reign as Shanghai Masters champion and reach the semi-finals after qualifying for the ATP Finals.

Daniil Medvedev's 6-3 7-6 (7-4) victory over Fabio Fognini sealed Tsitsipas' spot in the season-ending tournament in London for the first time and the 21-year-old capped a memorable Friday by beating Djokovic 3-6 7-5 6-3.

The sixth seed won his first encounter with the world number one at the Rogers Cup last year and gained revenge for a defeat in their second meeting in Madrid this season, having also beaten Roger Federer and Rafael Nadal in 2019.

Four-time champion Djokovic was denied back-to-back titles after his Japan Open Tennis Championships triumph last weekend as Tsitsipas struck 34 winners in a pulsating quarter-final in Shanghai, setting up a last-four contest with Medvedev. 

Djokovic was 3-0 up after only seven minutes in a blistering start and lost just one point in his first three service games.

Tsitsipas had a first break-point opportunity in the seventh game, but the 16-time grand slam champion prevented the world number seven from getting back on serve and took the opening set in just over half an hour.

Djokovic got himself out of trouble to level at 3-3 in the second set after drilling a forehand long to gift his opponent a couple of break points.

Tsitsipas, runner-up at the China Open last week, continued to put the Serbian under pressure, though, and got the elusive break to level the match as he continued to unleash winner after winner.

One of 26 unforced errors from Djokovic gave Tsitsipas, who produced an array of searing backhand and forehand winners, three break points and he grasped the opportunity to take a 3-1 lead in the third before going on to seal his place in the penultimate round.