Carlos Tevez fired West Ham to a shock win at champions Manchester United to help keep his side in the Premiership.
Match-winner Tevez remains at the centre of controversy
The Argentine - at the centre of a row over his registration - scored on the stroke of half-time from close range.
Manchester United wasted a string of chances as West Ham fought fiercely for their top-flight status at the expense of Sheffield United who lost to Wigan.
West Ham stood firm to pull-off an amazing relegation escape and spoil Sir Alex Ferguson's title party.
A weakened Manchester United side were celebrating their 16th English league title against a Hammers team who needed a point to guarantee their Premiership status.
Sir Alex Ferguson left a host of star names on the bench and there were no complaints from his West Ham counterpart Alan Curbishley.
West Ham started confidently enough but it was the champions who had the first clear opportunity when Rooney squandered a great chance to open the scoring after Darren Fletcher's through-ball.
Wes Brown was twice called into action at the other end to clear his lines as the Hammers showed plenty of willingness to attack.
The home side looked the more likely to break through and Rooney, Alan Smith and Ole Gunnar Solskjaer all had half chances as West Ham held firm.
Yossi Benayoun rescued West Ham twice in a matter of seconds when he first headed Smith's flicked effort off the line, then stood firm as Kieran Richardson let fly with the rebound.
Tevez appealed for a penalty when his shot flicked off Brown but had to make do with a corner, which Fletcher cleared.
Robert Green then made a superb fingertip save to deny John O'Shea at the other end before Rooney screwed his volley wide after Heinze picked him out with a superb far-post cross.
West Ham took the lead in injury time, the home defence failing to deal with Green's long punt down field and, after exchanging passes with Bobby Zamora, Tevez squeezed his shot home.
The Red Devils were struggling to make any headway and Ferguson made a triple substitution before the hour mark with Patrice Evra, Michael Carrick and Alan Smith replaced by Ryan Giggs, Paul Scholes and Cristiano Ronaldo.
The Hammers were forced back by wave after wave of red attacks which came to very little before Luis Boa Morte blazed a shot high and wide from a Nigel Reo-Coker cross.
West Ham survived several more near misses as cries of "champions, champions" echoed around Old Trafford.
But it was West Ham who deserved the victory after a lacklustre display from the home side with the FA Cup final just six days away.
For West Ham it was the culmination of a six week-long miracle relegation escape - that is unless the Sheffield United lawyers have their way.
Man Utd: Van der Sar, O'Shea, Brown, Heinze, Evra (Giggs 57), Solskjaer, Carrick (Scholes 58), Fletcher, Richardson, Smith (Ronaldo 58), Rooney.
Subs Not Used: Kuszczak, Vidic.
West Ham: Green, Neill, Collins, Ferdinand, McCartney (Spector 28), Benayoun, Reo-Coker, Noble, Boa Morte, Zamora (Harewood 63), Tevez (Mullins 82).
Subs Not Used: Walker, Davenport.
Booked: Collins, Tevez.
Goals: Tevez 45.
Ref: M Atkinson (W Yorkshire).