Andy Murray and Novak Djokovic will fight to finish as year-end world number one in today’s final of the ATP World Tour Finals in London. The Briton, 29, beat Milos Raonic in a gripping semi-final 5-7 7-6 (7-5) 7-6 (11-9) in three hours and 38 minutes to reach his first season-ending final. Djokovic swept past Kei Nishikori 6-1 6-1 in his last four encounter.

The winner will end the year top of the world rankings, the first time the battle for the top spot has been fought in the final match of the season.

Murray’s earlier victory over Canadian fourth seed Raonic extended the Scot’s winning streak to a career-best 23 matches, stretching back to September. It was Murray’s second lengthy encounter in four days.

“I didn’t expect to play a long one with someone with a serve like Milos,” said Murray. “I’m tired. I’ve played so much tennis over the last few months. I’ll give it my best effort – the best of what I have.”

Murray was yelling at himself and 17,000 spectators were screaming with every twist and turn before he finally prevailed in an extraordinary contest. He twice failed to serve out the match as the clock ticked past three hours in the final set, and three match points then slipped by in the tie-break.

“It was an amazing atmosphere,” added Murray. “The longer the match went on, the louder the crowd got. This is what we play for. Matches like this and arenas like this. This is one of hardest matches I’ve played indoors.”

Murray and Djokovic’s unprecedented clash for pole position will end with one of the old rivals finishing the year on top of the world after the Scot shattered his rival’s 122-week reign at number one earlier this month.

Fittingly, they will bring the curtain down on the ATP season with both the prestigious Tour Finals title and the top spot up for grabs in today’s final at London’s O2 Arena.

Murray is just one win away from capping a dream year in perfect fashion. But Djokovic can say exactly the same after the defending champion thrashed Japan’s Kei Nishikori 6-1, 6-1 in the other semi.

Djokovic, who has a 24-10 lead in his head to head with Murray, said: “This is one of the biggest matches we will ever play against each other. The match everybody anticipated. This has never happened in the history of tennis. I’m privileged to be part of history.

“My level had been going in the right direction. Now it’s coming up to the last match of the year. I hope we get a great final.”

Crucially, Murray might be on his last legs after having to survive a three-hour 39-minute epic against Raonic that ranked as the longest match in Tour Finals history — eclipsing the record mark set when Murray beat Nishikori in three hours and 20 minutes on Wednesday.

While Murray’s body has been pushed to its limits this week, Djokovic has enjoyed smooth progress to the final and, unlike his opponent, the world number two will be well rested following his 67-minute demolition of Nishikori.