Rafa Nadal has feasted on Russian opposition in the past but Karen Khachanov nearly served up a major U.S. Open upset, forcing the world number one to rally for a breathless 5-7 7-5 7-6(7) 7-6(3) third round win.
Not since 2011 has Nadal lost to a Russian but his string of 16 victories stretching back to 2011 looked ready to end along with his U.S. Open title defence when big-hitting Khachanov came out with guns blazing.
The 27th seed kept up the pressure throughout a four hour, 23 minute thriller that was the Spaniard's longest ever match at Flushing Meadows.
"I am very happy to be through in a very tough situation," Nadal said in an on-court interview.
"There were some tough moments during the match, but he played aggressive. There are things to work on for the next round, but the good thing is I have a chance to improve."
After coasting through his first two matches, Nadal appeared poised for another uneventful day against a 22-year-old he had beaten four times without dropping a set.
That run came to a halt when the Russian took the opener by pounding eight aces past a misfiring Nadal, including one to clinch the set.
The Spaniard found himself in an even deeper hole when Khachanov collected the early break in the second, putting Nadal on the ropes down a set and a break 5-4.
No player in tennis, however, is more dangerous than Nadal when threatened and, with Khachanov serving for a 2-0 lead, the 17-times Grand Slam champion's famous survival instincts kicked in and he snatched a clutch break.
Rain began to fall while Nadal celebrated, forcing a delay as the Arthur Ashe stadium's retractable roof was closed and providing the defending champion with an opportunity to regroup.
When play resumed, a focused Nadal went to work holding serve and then breaking again to get the match back on level terms.
But Khachanov was also in the mood for a fight and the third set went to a tie-break which Nadal won 9-7 with the help of three double faults.
The tie-break seemed to deflate Khachanov as Nadal moved in for the kill, grabbing the early break in the fourth to jump in front 2-1.
But the drama was not over yet and the massive crowd surrounding the stadium waiting to watch the Williams sisters' primetime showdown was forced to wait a little longer.
Khachanov, with Nadal serving for the match, dug deep to break the Spaniard yet again and force another tie-break but that was as far as the Russian revolt went with Nadal progressing to a fourth round meeting with Nikoloz Basilashvili.
Fifth seed Kevin Anderson came through a second marathon match at this year's U.S. Open, defeating flamboyant Canadian Denis Shapovalov 4-6 6-3 6-4 4-6 6-4 to set up a fourth-round clash with Austria's Dominic Thiem.
Anderson, losing finalist last year at Flushing Meadows, fired 11 aces and clubbed 31 winners in his second five setter of the week after going the distance in his first-round battle with American Ryan Anderson.
Big-serving Canadian Milos Raonic halted former champion Stan Wawrinka's charge in New York, beating the Swiss wildcard 7-6(6) 6-4 6-3 to book his berth in the last 16.
Next up for the 27-year-old is a last-16 clash with American John Isner, the 11th seed, who beat Serbian Dusan Lajovic.