The 20-time Grand Slam champion lost the first set despite having held set point in the tiebreak and had Djokovic in trouble in the final set when the Serb received a code violation at 4-4 for chucking his racket away in disgust after the Swiss had saved two break points.
However, that didn't mean that Federer won't make him sweat and Djokovic had to endure much more than he expected in the semi-final match before he eventually won 6-7, 7-5, 6-7.
Djokovic struggled to handle Khachanov's brutal two-handed, cross-court backhands from the baseline, which often landed near his ankles, and dropped his serve again to trail 2-1 in the second set.
But world number 18 Khachanov, unbeaten in three previous finals, hit back in the very next game as Djokovic dragged a forehand into the tramlines, down break point. "He can really hurt you", Djokovic said. However, the Serb superstar avoided a question about the effects of exhaustion on his Sunday game.
"We had epic matches throughout our rivalry but this one definitely ranks as one of the best matches we played", Djokovic told reporters.
'So all the credit to him.More news: Floyd Mayweather Jr. schedules bout in Rizin Fighting Federation
More news: Sri Lanka rivals woo defectors in bid to end impasse
More news: Juventus vs. Cagliari - Football Match Report
Russia's Karen Khachanov celebrates his first Masters triumph following a memorable win over Novak Djokovic.
"When you lose a close match like this you always have regrets", Federer, who remains one title shy of 100 career trophies, told the crowd, according to the Washington Post. "And maybe I'm not crying, but still I'm really happy".
Thiem, the world No 8 who on Friday had booked his place in this month's ATP Finals in London, was out of sorts and seemed rushed by the depth and power of Khachanov's groundstrokes. And what more can I ask for?
"I watched (Safin's) matches but later, not at the age of eight", he said.
But world number 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.
Although Khachanov denied Djokovic, the opportunity of clinching his fourth Paris Masters title and his record-equalling 33rd, he will be consoled by the fact that he will become the World Number One on Monday, replacing Rafa Nadal, who pulled out of the tournament because of injury.