LONDON (AFP) - Roger Federer knocked Japan's Kei Nishikori out of the ATP Tour Finals and guaranteed top spot in his group with a 7-5, 4-6, 6-4 victory on Thursday.
Federer had already clinched a record 13th Tour Finals semi-final place after ending Novak Djokovic's three-month, 23-match winning run on Tuesday.
But the 34-year-old still needed to beat Nishikori to be certain of advancing as the group winner and he finished the job in two hours and 10 minutes to secure his third successive victory at the prestigious season-ending event at London's O2 Arena.
"It was a really important one for me, to move on (to the semi-finals) with a good feeling," Federer said.
"There's points on the line and prestige, wanting to beat Kei, winning at the O2. I want to do well here."
Nishikori added: "Each set I didn't start well. Every time he broke first and I was on the defensive all the time. That was my big mistake.
"In the end it was a really close game, just a couple points that I didn't play quite well enough. It's a shame to lose like that."
Federer, who has won the Tour Finals a record six times, will face either Andy Murray or Stan Wawrinka in the last four on Saturday.
Murray and Wawrinka clash on Friday to determine the second qualifier from the other group, which has already been won by Rafael Nadal.
The second semi-finalist from Federer's group will be decided later on Thursday when world number one Djokovic plays Tomas Berdych.
Defending champion Djokovic will be through if he wins in two or three sets and he would still qualify if he loses in three sets, with only a straight sets win for Berdych enough to send the Czech in the last four.
Nishikori's last meeting with Federer had also been at the Tour Finals 12 months ago and ended in a heavy defeat for the Japanese star.
This time the 25-year-old put up much more of a fight, but once again he was denied a third career win over the player he grew up idolising.
Nishikori has struggled with a host of injuries during a disappointing 2015 and, still troubled by fitness issues this week, he could have allowed his season to fizzle out when a wayward backhand gifted Federer a break in the fourth game of the first set.
But Nishikori is too spirited a competitor for that and he broke back in the next game.
Nishikori broke again in the seventh game, converting with a ferocious crosscourt winner that left his opponent rooted to the spot.
Yet as suddenly as Nishikori had seized the advantage, he found it vanished just as quickly as Federer took advantage of a sloppy service game to break again.
Unable to find a solution to Federer's pressure, Nishikori finally wilted in the 12th game with a pair of unforced errors surrendering the first set.
It looked all over for Nishikori when he trailed 4-1 in the second set, but to his credit he came back fighting and started to go for winners with almost every shot.
His cause was aided by a drop in Federer's intensity and the former US Open finalist made him pay when he broke back in the seventh game.
Now Nishikori was the aggressor and he broke again for a 5-4 lead before closing out a set that looked beyond him moments earlier.
Federer regained the initiative when he broke for a 3-1 lead in the final set, yet the indefatigable Nishikori clawed his way out of trouble with a break in the seventh game.
However, Federer wouldn't be denied and he unloaded a booming smash to finally see off Nishikori on his first match point.