Nadal was looking for his third slam title of the year after winning the Australian Open and French Open to take the lead in the overall race but he was overpowered by Tiafoe in a 6-4 4-6 6-4 6-3 victory.
No American man has won a grand slam title since Andy Roddick at Flushing Meadows in 2003, by far their longest drought in tennis history.
Now Tiafoe, the 24-year-old son of immigrants from Sierra Leone who slept in the office of a tennis centre in Maryland as a child where his father was the caretaker, is right in the mix in a tournament that has been blown wide open by defeats for first defending champion Daniil Medvedev and now Nadal.
Tiafoe said of his win: “I don’t even know what to say right now. I can’t believe it. He’s one of the greatest of all time. I played some really good tennis. Something special happened today.”
Nadal went into the US Open short on matches after suffering an abdominal tear that forced him to withdraw from Wimbledon ahead of the semi-finals.
Tiafoe began the contest having not dropped a set and bidding to reach the quarter-finals for the first time in his third straight trip to the fourth round.
The American is a natural crowd-pleaser with his flashy game and vibrant personality, and he took full advantage of a rather sluggish start to the match from his opponent.
There were a smattering of boos when Nadal finally returned from an eight-and-a-half-minute off-court break at the end of the first set, during which he reportedly had his wrists taped.
The 22-time grand slam champion was still not at his best but he kept his nose in front on serve and then seized his opportunity to level the match when Tiafoe double-faulted.
If the crowd expected Nadal to pull clear in the third, though, Tiafoe did not follow the script, breaking through the Spaniard’s legendary powers of defence time and again with his power and racing to his seat after breaking for 4-3.
He served out the set with one of the best games of the tournament, crunching back-to-back winners and then clinching it with an ace.
Both men left the court for lengthy breaks before the fourth, which saw Nadal perform a leaping fist-pump towards his team after fighting off a break point in the opening game.
He moved into a 3-1 lead, with Tiafoe receiving a warning for swearing after dropping serve while the roof closed on Arthur Ashe, but the second seed still did not look settled and back came his opponent with a run of five games in a row to clinch the biggest win of his career.