Rafael Nadal produced a sensational 'around-the-net' winner during a thrilling victory over Marin Cilic.
The Spanish second seed dropped a set for the first time in the tournament but still saw off the 2014 champion 6-3 3-6 6-1 6-2 to move a step closer to a maiden Flushing Meadows meeting with Roger Federer.
Nadal was clearly irritated when given a time violation as he served midway through the second set, and was broken moments later.
But the three-time champion quickly shrugged it off to march into the last eight, with a stunning around-the-net winner bringing up match point to the delight of an Arthur Ashe crowd which included Nadal's friend Tiger Woods.
"It's an easy shot to describe, but difficult to make," said Nadal. "I don't know, I think I followed the ball good because he had a good volley and I saw it.
"I ran fast to the ball and I saw at the last moment there would maybe be a small space on that side.
"I think it was the only way to win that point. I hit it well, but to hit that spot you need some luck."
It is a statistical quirk that Federer and Nadal, rivals across 15 years and 40 matches, have never met at the US Open.
But defending champion Novak Djokovic's exit has opened up the possibility of a box-office final between the pair.
Federer faces Grigor Dimitrov, a player he has beaten seven times out of seven, in the last eight.
Nadal will take on Diego Schwartzman after sixth seed Alexander Zverev ran out of steam in his bid to reach the quarter-finals for the first time.
The 22-year-old had already played 14 sets in three matches before taking on Schwartzman in round four.
He took the first set but Argentinian Schwartzman hit back to win the next two.
There was controversy when Zverev was given a point penalty after an audible obscenity, giving Schwartzman a 5-2 lead in the fourth.
Umpire James Keothavong had earlier issued a warning when Zverev smashed a ball away, but the German claimed he had not heard it.
"I mean, a code violation is fine. I didn't even argue that," he said. "But neither of us heard me getting a warning in the first place.
"So it was like, OK, a warning is fine, it's no problem, but why am I getting a point penalty?
"He said he gave me a warning before. I didn't hear it. Diego didn't hear it. Most of the crowd didn't hear it.
"OK, it happened. It happened. It's fine. I think the umpires next time should let me know about it."
Matteo Berrettini, the Italian 24th seed, roared through in straight sets against unseeded Andrey Rublev.
Russian Rublev had previously beaten seeded players Stefanos Tsitsipas and Nick Kyrgios but he found Berrettini too strong, losing 6-1 6-4 7-6 (6).
He will play Frenchman Gael Monfils, who looks to be playing some of the best tennis of his flamboyant but injury-hit career this fortnight.
Monfils beat Spain's Pablo Andujar 6-1 6-2 6-2.