France's Lucas Pouille claimed the biggest win of his career as he beat two-time champion Rafael Nadal in a sensational US Open last-16 match.
The 22-year-old recovered from a break down in the fifth before converting his fourth match point in the tie-break to win 6-1 2-6 6-4 3-6 7-6 (8-6).
"It took everything. I could not dream better than that," the world number 25 said after his four-hour victory.
Pouille will play compatriot Gael Monfils, who beat Marcos Baghdatis.
The defeat means that 2016 is the first year since 2004 in which Nadal, 30, has failed to reach a Grand Slam quarter-final.
"I am close to being 100% again and I believe I can have a couple more good years," said Nadal whose most recent Grand Slam title came with his ninth French Open in 2014.
His best runs since have been two quarter-final spots at the 2015 Australian and French Opens.
"I fought to the end today but I needed something that was not there. I will keep working to try and find it."
Elsewhere Jo-Wilfried Tsonga, also of France, ended American interest in the men's singles by beating Jack Sock.
His win gave France three men's quarter-finalists at the American Grand Slam tournament for the first time in 89 years.
The ninth seed will play world number one Novak Djokovic, who beat British number four Kyle Edmund in straight sets.
Fourteen-time Grand Slam champion Nadal had dropped only three games in an emphatic win in the pair's only previous meeting, but Pouille has been on a steady rise through the rankings since that 2015 defeat in Monte Carlo.
On his first appearance on the centrepiece Arthur Ashe court, he showed why with an assured touch at the net and a relentless determination to attack his groundstrokes.
Having led two sets to one, it seemed that Pouille might have to be content with valiant defeat when Nadal moved 4-2 up in the decider.
But the Wimbledon quarter-finalist prised his way back into the match and it was Nadal who faltered in the tie-break, netting a short forehand at 6-6 to hand his opponent a fourth and fatal chance to close out the match.
"With three match points I thought, 'you are going to win this one'. At 6-6, I was not the same. Honestly I am the most happy in this tournament," added Pouille, whose last three matches have gone to five sets.
Great Britain Davis Cup captain Leon Smith on 5 live sports extra:
Lucas Pouille has everything, he has a big serve, is not scared about coming forward to the net and has a strong forehand and backhand. There is no hole in his game and someone is going to have to play really well to beat him.
Nadal does not have the speed that he used to have and makes a few more unforced errors. He is not as clinical as he was in his prime. He is still playing very well, but is not playing as well as he used to.