The only previous time they had met, Djokovic crushed the Russian in straight sets at Wimbledon and, briefly, it seemed as if the same fate could await Khachanov again as he was out-rallied to go 3-1 down in the opening set.
He saved a break point with a sharp volley at the net when serving for the set at 5-4 and then broke Nishikori at the start of the second set to take firm control.
The Russian number two now has 15 match wins at this level this year, including a trip to the semi-finals of the Rogers Cup in Toronto.
Austrian sixth seed Dominic Thiem reached the quarter-finals in Paris for the first time, seeing off in-form Borna Coric 6-7 (3/7), 6-2, 7-5.
"He's a young player, up and coming, but already an established player, a top player".
"For the most part I can be happy, my level was good, but losing is never fun", said Federer.
The 22-year-old, ranked at number 18 in the world, simply refused to allow the new world number one to settle in the showpiece encounter. "My priority is London, but now I am so far into the tournament I'll just give it a go and hope things click for me".
Spice Girls announce new tour for 2019
The group is set to reveal all the details of the tour around Monday morning, but Baby Spice. Mel B also hopes so too, as she admitted the door will always be open for the mum-of-four .
"When you lose a close match like this you always have regrets", he said.
Roger Federer, who has skipped the French Open the last two years, insisted Saturday he has "no idea" whether he will play at the clay-court Grand Slam next season. I know I can play better.
Djokovic, who has been an impervious force over the past four months, said, "The quality of his serve tonight was quite unbelievable, to be honest".
But World No 18 Khachanov, a victor at the Kremlin Cup in Moscow last month, hit back in the very next game as Djokovic dragged a forehand into the tramlines, down break point.
Federer was seeking to become only the second man after Jimmy Connors to win a century of professional tour titles following his 99th win in Basel, only to fall agonizingly short. And what more can I ask for?
Cilic and Thiem sealed the last two spots for the season-ending ATP Finals in London, starting on November 11.
Djokovic has won his last four meetings with Federer and now leads the Swiss 25-22 overall, having not lost to the 20-time Grand Slam champion since 2015.
'And he showed great quality today and he showed why we're going to see a lot of him in the future'.