Andy Murray turned his attention to rest and recovery as he bids to stay on course for the "perfect" final against Novak Djokovic at the ATP World Tour Finals.

Murray and Kei Nishikori played the longest three-set match in the tournament's history on Wednesday - the Scot eventually prevailing 6-7 (9/11) 6-4 6-4 after three hours and 20 minutes.

The first set alone took 85 minutes, Nishikori winning it on his fifth set point, but Murray's well of fighting spirit never runs dry and he dug himself out of several holes on his way to a 21st consecutive victory.

It is the first time since the tournament moved to London's O2 Arena in 2009 that Murray has won his opening two matches, but his place in the semi-finals is not yet guaranteed after Stan Wawrinka defeated Marin Cilic 7-6 (7/3) 7-6 (7/3).

Murray needs to take a set off Wawrinka on Friday to be sure, while Cilic is eliminated and can turn his attention to Croatia's Davis Cup final clash with Argentina next weekend.

Should Murray win the group, he would avoid Djokovic in the last four, setting up the mouth-watering prospect of a final on Sunday with the number one ranking on the line.

The 29-year-old said: "I think for the tournament and stuff, for everyone interested in tennis, that would probably be the perfect way to finish the year.

"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, someone else, or, for me, if it's winning against Novak or another player, it doesn't change for us as players."

The Scot headed for the ice bath following the match, not holding his press conference until nearly three hours later.

Murray said: "I'm a bit tired, obviously. I was in the ice bath after the match. That helps make you feel a bit better.

"But 10, 12 hours afterwards the body starts to stiffen up. I'm sure I'll be a bit sore. But it's positive I get a day's rest."

The prospect of Murray and brother Jamie both finishing 2016 ranked at the top of the standings moved a step closer when Nicolas Mahut and Pierre-Hugues Herbert crashed out of the doubles tournament.

Djokovic has already booked his place in the semi-finals (Getty)

The French pair are currently ranked number one but reaching the final would definitely now be enough for Murray and Brazil's Bruno Soares, who have won both matches so far and play Marcelo Melo and Ivan Dodig on Thursday.

Meanwhile, Djokovic will take on alternate David Goffin in his final group match after Gael Monfils, who was already eliminated, pulled out with a rib injury.

The winner of the evening clash between Milos Raonic and Dominic Thiem will join Djokovic in the last four.