The defence of his world No 1 ranking is inspiring Andy Murray to new heights. It has taken the Scot eight years to begin a campaign at the Barclays ATP World Tour Finals with two successive round-robin victories and he finally achieved that here in London with a hard-earned 6-7, 6-4, 6-4 win over Kei Nishikori. The 26-year-old Japanese, who was the last player to knock Murray out of a tournament when he beat him in the quarter-finals of this summer’s US Open, pushed the Scot to the limit but was unable to deny him his 21st victory in succession.

Novak Djokovic, who has already booked his place in Saturday’s semi-finals, can still take back the world No 1 ranking by winning the title here for the fifth year in a row, but there is a fire in Murray’s eyes as he continues his defence of the position he took from the Serb last week.

Murray faces Stan Wawrinka in his final round-robin contest on Friday and may yet have to win that match to secure his place in Saturday’s semi-finals. Wawrinka beat Marin Cilic 7-6, 7-6 in the second of Wednesday’s round-robin matches to keep alive his own chances of qualifying.

The tournament could be heading for a dream final on Sunday between Murray and Djokovic which would also determine the year-end world No 1 ranking. Murray agreed that many within the sport would see that as “the perfect way to finish the year”.

He added: “For me and I’m sure for Novak, both of our goals would be to try to win the event. For him, whether that’s by beating me or someone else, or for me if it’s winning against Novak or another player, it doesn’t change for us as players. But for the event and everyone interested in tennis, I’m sure that would be the most exciting way to finish the year.”

For whatever reason, Murray has not always played his best tennis at this tournament and he needed to grit his teeth to find a way past Nishikori, who has been a thorn in his side this year. Murray beat the world No 5 in five sets after nearly five hours in the Davis Cup in Birmingham in March, while Nishikori reversed the result over five sets and nearly four hours at the US Open in September.

On this occasion a match which began with a first set littered with mistakes by both men blossomed into a gripping contest. It took three hours and 20 minutes, which made it the longest hard-court match played over three sets anywhere this year. It was also eight minutes longer than the previous longest recorded match here, when Murray lost to Rafael Nadal in the semi-finals in 2010.

It was Murray's second match as World No 1 (Getty)

Considering what consistently good ball strikers Murray and Nishikori are, the first set was a surprising collection of mistakes and missed opportunities. It took 85 minutes and featured 40 unforced errors (20 by each man) and only 25 winners.

Neither player found a consistent rhythm on their ground strokes in the first set and Murray in particular struggled to get enough first serves in court. Nishikori set the pace in most rallies but failed to take any of his three break points. Murray created just one, in the 12th game, which he failed to take when he put a forehand in the net.

Nishikori went 6-3 up in the tie-break, only for Murray to level at 6-6. He saved the third set point with a moment of sheer brilliance, guessing exactly where Nishikori would hit what should have been a backhand winner and then returning it beyond his opponent’s reach.

The arena erupted in celebration, but Murray was unable to capitalise. Nishikori went on to save two set points – the second of them only after Murray had kept a rally going with another breath-taking recovery shot – and the set finally ended in predictable fashion when the Scot hit a loose forehand wide of the line.

Murray, nevertheless, came out with a more positive approach at the start of the second set, moved further up the court and broke serve in the opening game. Nishikori broke to level at 4-4, only for Murray to break back immediately. The Scot twice went break point down when serving for the set before closing it out when Nishikori missed a forehand. The look on Murray’s face spoke of relief as much as celebration.

Nishikori beat Wawrinka in the first round-robin match (Getty)

In the deciding set Murray took command by breaking in the third game. Nishikori, to his enormous credit, retrieved one of two breaks when Murray served for the match at 5-2, but the Scot made no mistake at the second time of asking, serving out to love to complete his victory.

Murray said afterwards that he felt tired but expected to feel even worse in the morning. “About 10 or 12 hours afterwards the body starts to stiffen up,” he said. “I’m sure tomorrow I’ll be a bit sore. But it’s positive I get a day’s rest tomorrow.”