The United States will contest the Confederations Cup final after causing a huge upset in Bloemfontein last night by inflicting a first defeat on Spain since 2006.
Jozy Altidore and Clint Dempsey scored the goals as underdogs USA, having lost their opening two games in the tournament and only squeezed through Group B by the skin of their teeth, set up a final showdown against either Brazil or hosts South Africa on Sunday.
The result was one of the biggest shocks in recent international history, with the all-conquering Spanish having broken the record for consecutive wins with their 15th on the trot against South Africa at the weekend.
The European champions would also have claimed the record for the longest unbeaten run if they had avoided defeat tonight, having drawn level with Brazil's run of 35 in that South Africa match.
Even the 86th-minute dismissal of Michael Bradley - son of coach Bob - could not deny the USA, who were left to celebrate a famous victory.
The Americans started brightly and Spain goalkeeper Iker Casillas found his goal under threat from Altidore and Charlie Davies early on.
Davies' then threatened again with a glancing header across the face of goal, and when Dempsey drilled a 25-yard shot just wide in the eighth minute, the Spanish must have wondered what was going on.
The world's top-ranked side did not take long to fashion some chances of their own though.
Cesc Fabregas sent a dipping shot over the bar and then the Arsenal captain threaded over a superb cross that Fernando Torres was just unable to convert at the far post.
That was all in a breathless opening 12 minutes, and both sides continued to push forward before the US took a shock lead through Altidore in the 26th minute.
Dempsey played the ball into his strike-partner on the edge of the box and the 19-year-old was allowed to turn Villarreal team-mate Joan Capdevila far too easily before firing in a shot that Casillas got his hand to but could not keep out.
That was the first goal Spain had conceded in their Confederations Cup campaign and only the third since Vicente del Bosque took over last summer, with this being the 14th match under the former Real Madrid boss.
The Spanish were under real pressure and, after David Villa had blazed a half-chance over the bar, the US had a great chance to make it 2-0.
Two US players were unmarked at the far post as they raced in to meet Landon Donovan's free-kick, but while captain Carlos Bocanegra was probably the better placed, Dempsey stretched to get his head to the ball and could not get it on target.
Despite that wasted opportunity, the US still held onto their 1-0 lead until the break, with Tim Howard sticking out a foot to deny Torres at his near post just before the interval.
With their proud record in danger, Spain came out at the start of the second half with all guns blazing.
Just two minutes after the re-start Howard produced a superb save to tip away Villa's effort, before Xabi Alonso fired a rising shot just over the crossbar.
It was all one-way traffic and Villa and Albert Riera both tried their luck, while Xavi had a good shout for a penalty following a challenge by Donovan inside the area.
The shots continued to rain in on Howard's goal, with the Everton custodian doing well to keep out efforts from Fabregas and Sergio Ramos in quick succession.
Spain could not find the breakthrough though, and their hopes of reaching the final were crushed when the US netted their second goal in the 74th minute.
Donovan's low cross should really have been cleared by Ramos at the far post, but Dempsey showed quick reactions to prod the ball away from the Real Madrid defender and past Casillas.
Spain got a brief glimmer of hope when Bradley was shown a red card for a heavy challenge on Alonso, but Del Bosque's side could not take advantage as the slumped to their first loss since going down 1-0 at home to Romania in a friendly in November, 2006.