World number one and defending champion Rafael Nadal came back from a set and break down to defeat big-hitting Karen Khachanov 5-7, 7-5, 7-6 (9/7), 7-6 (7/3) and reach the US Open fourth round on Friday.
The top seeded Spaniard triumphed after an epic 4 hour 23 minute struggle on Arthur Ashe Stadium in a match where the 22-year-old Khachanov had served for a two sets to love lead in the 10th game of the second set and had a set point in the fourth-set tiebreaker.
Nadal, seeking a fourth US Open title and 18th career major, will face Georgia's world number 37 Nikoloz Basilashvili for a place in the quarter-finals.
Basilashvili reached the last-16 of a Slam for the first time by seeing off Argentina's Guido Pella 6-3, 6-4, 1-6, 7-6 (7/4).
"I was in a tough situation and I am very happy to escape," said Nadal who has now reached the fourth round in New York for the 10th time.
"I served for the match at 5-4 in the fourth set but made mistakes.
"The good thing is that I will get another chance and I can work on things before the next match."
Khachanov, 22, bidding to make the last 16 of a Slam for the third time this year, made his intentions clear from the start -- the only way to beat the Spaniard, against whom he had lost four times in four, would be all-out attack.
He broke for 2-1, handed it back at 4-4 before edging ahead again for 6-5.
The young Russian watched three set points slip away in the 12th game before wrapping up the opener with his eighth ace of the 22 he was to serve in the match.
It was the first set he had taken off Nadal.
Nadal, who converted just one of five break points in the set, needed strapping to support his right knee in the changeover.
He was quickly down 3-1 in the second set before battling back to 4-4.
Khachanov then cracked when serving for a two sets lead with the pair back on serve at 5-5.
A further twist was added when light rain began to fall and the Arthur Ashe Stadium roof was closed.
The delay worked to Nadal's advantage with a love service hold and a break to level the contest.
A thrilling tiebreak settled the third set with Nadal clinching it after a lung-busting 39-shot rally on a fifth set point, shrugging off a time violation on the third.
But the drama wasn't over as Nadal was broken in the 10th game of the fourth set as he served for the match
He then saved a set point in the 12th game before cruising through the tiebreaker to claim his 25th win against just one loss since capturing an 11th Roland Garros title in June.
South Africa's Kevin Anderson, who was runner-up to Nadal last year, outlasted Canadian teenager Denis Shapovalov 4-6, 6-3, 6-4, 4-6, 6-4 as the roof on the new Louis Armstrong Stadium was closed for the first time.
Anderson, unable to convert four match points against Shapovalov's serve in the penultimate game, served it out with a love game of four unreturnable serves.
The fifth seed, runner-up to Novak Djokovic at Wimbledon, next faces ninth-seeded Austrian Dominic Thiem, who didn't have the luxury of a roof in a 3-6, 6-3, 7-6 (7/5), 6-4 victory over American Taylor Fritz on Grandstand.
Thiem was about to serve for the match when light rain halted play for 20 minutes at 5-3 in the fourth.
When play resumed he served three double faults to get broken before finishing off the match in the next game.
Thiem has now put together three wins in a row for the first time since finishing runner-up to Nadal at Roland Garros.