Winston Reid proved the unlikely hero as West Ham claimed a thrilling 3-2 Premier League win over Manchester United in the final game at Upton Park to leave the visitors' Champions League hopes hanging by a thread.
West Ham's farewell to Upton Park was delayed by 45 minutes after Manchester United arrived late to the stadium, with their team bus coming under attack from fans outside the ground who threw bottles and other objects.
The hosts made a superb start when the match got underway, Diafra Sakho putting them ahead after 10 minutes with his first goal in six Premier League games.
However, United - who had the chance to go a point clear of rivals Manchester City in the battle for a place in the top four - turned things around thanks to a second-half double from Anthony Martial, who returned along with Marcus Rashford after missing last Saturday's win at Norwich City.
Slaven Bilic's men refused to say goodbye to their famous home with a defeat, however, as Michail Antonio headed in a leveller just four minutes after Martial's second.
And Reid settled a frenetic contest in West Ham's favour in the 80th minute with his header from Dimitri Payet's cross proving too strong for David De Gea to ensure a memorable send-off and boost the hosts' Europa League aspirations.
It did not take long for Upton Park crowd - who were stunned by Saturday's 4-1 reverse against Swansea City - to be sent into raptures as Sakho converted at the end of a well-worked team move.
Aaron Cresswell played a superb pass down the left for Manuel Lanzini, whose pull back was curled into the bottom-left corner by Sakho with a precise finish.
Andy Carroll wasted a glorious chance to double the lead nine minutes later as he was sent through on goal, but, with England manager Roy Hodgson in the stands, the striker could only muster a tame finish that David De Gea saved easily.
Payet was similarly profligate in the 31st minute when he shot high and wide after Mark Noble had robbed Martial of possession in midfield.
West Ham continued to dominate matters in the closing stages of the first half, with Louis van Gaal throwing midfielder Michael Carrick into the mix in place of Morgan Schneiderlin before the second-half restart.
And United levelled matters six minutes into the second 45 as Martial restored parity with a simple close-range finish.
Following an excellent clearance by De Gea, Rashford held the ball up for Juan Mata on the overlap and the Spaniard - who scored the winner against Norwich - produced an excellent ball across the face of goal from which Martial could make no mistake.
Payet bent an effort narrowly wide shortly after, with the France international then seeing a free-kick somehow turned over the bar by an unmarked Sakho.
United were grateful to Martial for his defensive efforts when he cleared a Carroll header off the line and he put his side ahead 18 minutes from time.
Rashford sprayed the ball out to the left for the Frenchman, who proved far too quick for Reid and fired beyond Darren Randolph from a tight angle.
But United's joy was short-lived as Payet delivered a dinked cross for Antonio to tie things up once more with an emphatic header.
There was a final sting in the tail from Reid, with De Gea unable to keep out his header despite getting a heavy hand to the ball, ensuring West Ham ended an era in style before moving on to a new beginning at the Olympic Stadium next term.