Cristiano Ronaldo's missed penalty for Manchester United proved crucial at West Ham as the Premier League champions were beaten at Upton Park.
Anton Ferdinand (left) and Upson were West Ham's matchwinners
United got an early let-off when Hayden Mullins hit the woodwork and Mark Noble blazed high from the rebound.
Ronaldo quickly made the Hammers pay when he headed in a Ryan Giggs cross.
But Ronaldo missed a penalty and that inspired West Ham into a late rally, which saw Anton Ferdinand and Matthew Upson each head in for the win.
The loss was only a below-par United's third of the top-flight campaign and was watched from the stands by manager Sir Alex Ferguson as he served a touchline ban.
He was unable to call on striker Wayne Rooney, who along with midfielder Michael Carrick, were suffering from viruses.
West Ham's fans had booed their side at the end of the last home game when the Hammers drew 1-1 with Reading but they vociferously supported their team at the start and their efforts almost reaped immediate dividends.
Lucas Neill sent a dipping shot just wide before the Hammers worked a glorious opening.
Mullins was slipped in on goal by Carlton Cole's clever touch but he angled a shot on to the crossbar as he tried beating on-rushing keeper Tomasz Kuszczak.
The ball rebounded to Noble and he looked certain to slot into a gaping net only to sidefoot high.
United quickly punished the home side with ex-Hammer Carlos Tevez, who was applauded at the start, beginning the attack on the halfway line as he held on to possession to drag right-back Neill out of position before finding Louis Saha.
Saha released Giggs into the space created by Tevez down United's left flank and the Welshman crossed for Ronaldo to nod in at the near post.
The goal briefly winded West Ham before they recovered as the game turned into a captivating contest with the home side pushing for a leveller and United a threat on the counter-attack.
Ronaldo put his side ahead but a also missed a spot-kick
Nolberto Solano had a curling 25-yard strike tipped over the bar by Kuszczak, while Giggs would have been clean through at the other end had his normally assured touch not let him down.
Hammers striker Cole had started ahead of Dean Ashton and he was found in space by Noble's cross but headed over.
Ronaldo dragged a shot wide of near post just before the end of a half which the Hammers ended the stronger.
But West Ham's main problem was their lack of ruthlessness in the final third with United's meagre defence also standing firm like so many times this season.
Solano and Scott Parker were forced off injured for West Ham shortly after the break as United tried to take the the sting out of the Hammers' play.
And the game should have been put out of the home side's reach after 66 minutes when the ball struck makeshift centre-back Spector's arm after he mistimed a dive to meet a cross.
Ronaldo stepped up to take the spot-kick only to power his strike wide.
The miss breathed new life into West Ham and their crowd and they produced a rousing finale as Anton Ferdinand equalised from a Noble corner as United defence finally broke.
Upson then rose highest to head a winner from a Noble free-kick into the top corner and the Hammers held on for only a third home win of the season.
West Ham boss Alan Curbishley:
"If you walk along the corridor here there are pictures of all the players on the walls and I reckon I had a whole wall out injured.
"We played ever so well in the first half and we were disappointed to be a goal down.
"It's a fantastic result considering I had 16 fit players and lost two more."
Manchester United boss Sir Alex Ferguson:
"I have no complaints. We were beaten by the better team. We were not nearly up to our normal performance.
"Scoring the penalty would have killed the game but if you lose goals to set pieces you are not at your best.
"It's difficult to say why but they are human beings and you can't expect them to be perfect all the time."
West Ham: Green, Neill, Spector, Upson, McCartney, Solano (Pantsil 49), Parker (Ferdinand 55), Mullins, Noble, Ljungberg (Ashton 70), Cole.
Subs Not Used: Wright, Camara.
Booked: Pantsil, Mullins.
Goals: Ferdinand 77, Upson 82.
Man Utd: Kuszczak, Brown (O'Shea 89), Ferdinand, Vidic, Evra, Ronaldo, Hargreaves (Nani 80), Fletcher, Giggs, Saha, Tevez (Anderson 64).
Subs Not Used: Heaton, Pique.
Goals: Ronaldo 14.
Ref: Mike Dean (Wirral).
BBC Sport Player Rater man of the match: Cristiano Ronaldo 7.86 (on 90 minutes).
Please note that you can still give the players marks out of 10 on BBC Sport's Player Rater after the match has finished.