Sixth seed Alexander Zverev ran out of steam in his bid to reach the US Open quarter-finals for the first time.
The 22-year-old had already played 14 sets in three matches before taking on Diego 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.
Schwartzman went on to win 3-6 6-2 6-4 6-3 and reach a third grand slam quarter-final.
The 5ft 7in 20th seed said: "It was great to play with this crowd, they helped in every important moment.
"I think Alex had problems with the serve, I'm a big returner and I took many chances. I played a great game."
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).