Roger Federer equaled Ivan Lendl's record of 12 semifinal appearances at the ATP Finals without stepping on court Thursday as Kei Nishikori defeated David Ferrer 4-6, 6-4, 6-1 in his final round-robin match.

Nishikori will have to wait for the outcome of the later match between Federer and Andy Murray to know if he makes it to the last four, but Ferrer sent Federer through by winning the first set.

Ferrer, who replaced the injured Milos Raonic on Thursday, took advantage of Nishikori's 18 unforced errors in the first set and made the decisive break in the 10th game when the Japanese player netted an easy smash.

Nishikori broke at the start of the second set before holding comfortably to even the score at one set apiece, making it the first match at this year's tournament to go to three sets following a run of eight one-sided encounters.

The fourth-seeded Nishikori left the court briefly after the second set but won four consecutive games upon his return. He saved five break points in the sixth game before holding his serve with a forehand drop shot winner.

Ferrer, the first alternate in London, missed out on qualifying for the tournament after his loss to Nishikori in the quarterfinals at the Paris Masters last month.

Nishiroki's three-set victory complicated Murray's task, with the home favorite now forced to beat the in-form Federer in two sets to advance.

The seventh-seeded Raonic withdrew with a muscle injury after losing his first two matches in Group B in straight sets.

"As badly as I wanted to play, you've got to be at the top of your game here and I couldn't be close to that today," the big-serving Canadian said. "Wouldn't have been fair to the fans if I had played a mediocre match or had to stop."