كتب : Amro Hassan
Jozy Altidore and Clint Dempsey scored in each half to hand their team a historic win over Vicente Del Bosque's men.
The bitter defeat, which was Spain's first in 35 games, ended La Fura Roja's record run of 15 straight wins.
USA stunned the European champions by taking the attacking initiative and they could have taken the lead twice within the space of three minutes.
A through ball nearly released Landon Donovan on 4 minutes before Iker Casillas rushed off his line to deny the former Bayern Munich man.
Charlie Davies produced a spectacular bicycle shot that missed the target before a Dempsey's effort from outside the box went inches wide of Casillas' post.
Bob Bradley's men were rewarded for their display when Altidore capitalized on a through pass by slotting a ball that touched Casillas' hands and went in.
The Spaniards pushed forward trying to find an equalizer, and they threatened on a number of occasions but the American resilient defence managed to maintain their lead.
Fernando Torres was unlucky to see his shot from a tight angle saved by Tim Howard's legs in the 45th minute.
After the interval, Spain brought everybody forward and David Villa's swerving left-footed shot was brilliantly kept out by Howard.
The Everton guardian punched away two attempts from Sergio Ramos and Xavi Alonso.
USA added a second against the run of play after a lovely move led by Ricardo Clarke found its way to Donovan, the latter's cross was rounded off by Dempsey after Ramos' poor clearance.
Michael Bradley was sent off for USA four minutes from time after a tackle on Alonso.
The reduction was late enough not to affect the CONCACAF champions, who will face either Brazil or South Africa in their first Confederations Cup final.