History repeated itself as Dominic Thiem defeated Novak Djokovic to reach the final of the Nitto ATP Finals.

Having fought back from 4-1 down in a final-set tie-break to beat Djokovic at London's O2 Arena 12 months ago, this time Thiem recovered from 4-0 to claim a remarkable 7-5 6-7 (10) 7-6 (5) victory.

But the scoreline only told half the story, with US Open champion Thiem missing four match points in the second-set tie-break only to claw his way back from the brink himself.

Last year's clash was in the group stages, with Thiem going on to lose a similarly epic encounter against Stefanos Tsitsipas in the final.

This time he will take on either Rafael Nadal or Daniil Medvedev with a chance to finish a season that finally brought him a longed-for grand slam trophy with another big title.

Djokovic won four straight titles in London from 2012 to 2015 but his efforts to equal Roger Federer's record of six victories have come to nothing since.

Having not lost a completed match until the French Open final last month, meanwhile, Djokovic's season has ended with a run of four losses in eight matches.

The 33-year-old was well below his best in a round-robin loss to Medvedev and, although he was much improved in his must-win contest with Alexander Zverev on Friday, there were still uncharacteristic errors.

Daniil Medvedev staged an impressive comeback to defeat Rafael Nadal for the first time and set up a decider against Thiem.

A glance at the grand slam winners' list will show that the old guard are still rightful leaders of the pack but the snapping at their heels has more bite now, particularly from Thiem and Medvedev.

Having seen Thiem somehow recover from 0-4 in a deciding tie-break to beat Djokovic in the first semi-final, Medvedev clawed his way back from a set and a break down to beat Nadal 3-6 7-6 (4) 6-3.

That maintained his record of not having lost a match this week and, coupled with his victory at the Paris Masters earlier this month, he is now on a nine-match winning streak.