Nadal overcame a knee problem to outlast an opponent 10 years his junior whose game gave him trouble across two marathon-length sets.
The Spaniard, who has won this tournament three times previously, will attempt to stop Federer's bid to capture a record sixth title when the two resume their rivalry Saturday.
Khachanov raced into a 2-0 lead in the opening set thanks largely to breaking Nadal's serve.
A Nadal hold got the Spaniard back in the set, albeit not without a few more problems for the 32-year-old:
Both players stayed strong on serve to forge a 3-3 tie. They each also worked well at the net, trading a series of quality backhands and slyly improvised hits.
The similarities in the form and range of shots of both players was not lost on Christopher Clarey of the New York Times:
Things continued in like-for-like fashion as a break from Khachanov evened the set at four games apiece. Nadal served to 5-4 and had seemed to have Khachanov reeling for the first time.
It was time for Nadal to turn on the style:
A double-fault appeared to wreck Kahachanov's chances to hold with the set at stake. The Russian eventually stood firm, though, something both men repeated as the set inched toward what felt like an inevitable tiebreak.
Nadal survived it to put himself in a commanding position, even if Khachanov had proved he wasn't going to make it easy for his decorated opponent.
It was 2-2 in the second set after Nadal needed the trainer to tape his right knee.
Nadal tried to seize control of the set by earning a break point, but Khachanov responded in kind for 3-3. The 22-year-old was now the one applying the pressure, with Nadal being forced to save several break points to even things at 5-5.
Despite being hobbled, Nadal clung onto his serve to push the set to another tiebreak. The illustrious veteran dominated the tiebreak, setting up four match points before getting over the line to complete a gutsy and clutch display.