By Martyn Herman

LONDON (Reuters) - Andy Murray has already scaled the tennis summit but Japan's Kei Nishikori did his best to loosen his footing before falling in a three-hour thriller at the ATP World Tour Finals on Wednesday.

Home favorite Murray's insatiable will power allowed him to prevail in a brutal encounter 6-7(9) 6-4 6-4, keeping him on course for his first title at the year-ender.

Should he achieve that in his eighth attempt it would guarantee the 29-year-old end the year as world number one ahead of Novak Djokovic who would steal back the crown if he manages a fifth straight title at the O2 Arena.

The path will be a rocky one though if Wednesday's cliffhanger -- the longest match in the event's seven-year residence in London -- is anything to go by.

Misfiring Murray looked in trouble when Nishikori edged a 20-point tiebreak to win an 85-minute opening set.

But he clawed his way back to claim a 21st consecutive victory in three hours and 20 minutes.

It avenged his five-set defeat at the hands of Nishikori in the U.S. Open quarter-finals -- from which he has since embarked on the run that snapped Djokovic's 122-week hold on power.

"I wasn't able to dictate many of the points," Murray said. "More so in the third set. But not in the first couple. I was having to run, fight, get as many balls back as I could.

"I eventually got over the line. These are the sort of matches you work so hard for."

With two wins from two, Murray would have been assured a semi-final berth had Marin Cilic beaten Stan Wawrinka in the later group match but Wawrinka recovered from his drubbing by Nishikori to win 7-6(3) 7-6(3).

Murray will now face U.S. Open champion Wawrinka on Friday knowing anything but a straight-sets defeat would suffice.

"Hopefully there will be another three days to this season and I'll do my best to get through them," Murray said.

Murray's game was out of kilter throughout a first set in which Nishikori's punchy groundstrokes led the Scot a merry dance. But he stubbornly kept his nose in front.

VERBAL AIM

He saved break points in the third, fifth and 11th games, aimed verbal volleys at coach Ivan Lendl and at one point the wedding ring he ties to a lace of his military style black shoes broke loose and threatened to roll away.

It was that kind of day and Murray scolded himself for wasting a set point at 6-5 on the Nishikori serve.

He then found himself 6-3 down in a tiebreak prompting a passage of play that had the crowd on the edge of their seats.

Nishikori missed a forehand by a whisker on his first set point and Murray tucked away a forehand to save a second. At 6-5 Nishikori, with acres of blue court gaping, chose wrong on an easy volley and Murray guessed right, clawing the ball past the Japanese from almost the front row of seats.

A dumbfounded Nishikori then saved two set points -- at 6-7 and 8-9 -- the second when he needed two smashes to get the ball past a clambering Murray. He then converted his fifth set point when Murray yanked a forehand wide.

Murray promptly broke at the start of the second set but let his lead slip when Nishikori fizzed a backhand pass to break for 4-4. Murray was reeling and Nishikori was scented victory.

But Murray won a couple of lung-burning rallies to poach another break then held firm to take the second set.

Murray drew first blood in the third thanks to a netcord, then saved yet more break points -- he fought off 9 from 11 in the match -- in the next game before forging 5-1 ahead.

Even then there was a twist as Nishikori mounted one last assault to reel off three games before Murray sealed victory.

(Reporting by Martyn Herman, editing by Pritha Sarkar / Ian Ransom)