Match ends, West Ham United 3, Manchester United 2.
West Ham United marked their departure from Upton Park after 112 years with a thrilling victory that may have ended Manchester United's chances of Champions League qualification.
Louis van Gaal's side knew victory here and at home to Bournemouth this weekend would secure a top-four place - but this loss means Manchester City are two points clear of them going into their final game at Swansea City.
The visitors' team coach arrived late and was attacked by Hammers fans as it made its way into the stadium, causing the kick-off to be delayed.
When the action got under way West Ham dominated and should have led by more than Diafra Sakho's goal at the break.
Antony Martial turned the game on its head and had Manchester United in charge with only 18 minutes remaining, first ending a sweeping move then beating Darren Randolph at his near post to put the visitors ahead.
West Ham, however, were not to be denied and two towering headers in the space of four minutes from Michail Antonio and Winston Reid gave them the victory they richly deserved.
- Relive the drama from Upton Park
- Man Utd coach attacked on way into Upton Park
- Listen to BBC Radio 5 live commentary highlights
- In Short: Jealousy towards 'special Man Utd' - Sullivan
- Podcast: A great finale for Upton Park - Brooking
Manchester United fall short again
Manchester United had their fate in their own hands knowing two victories - here and at home to Bournemouth on Sunday - would assure Champions League football next season.
It was typical of their misfiring season that they squandered this chance with a performance that was for the most part lifeless, only lifted above mediocrity by the brilliance of Martial.
United may have been affected by that late arrival and the delayed kick-off, but their first 45 minutes fell well short of what was needed given how high the stakes were. It was only down to West Ham's generosity in front of goal that Van Gaal's side were only 1-0 down at the interval.
And when, against the run of play and thanks to Martial's excellence, they found themselves ahead with 18 minutes left they were still not good enough to make it count.
The hosts finally took their chances and scored twice in four minutes to once again reveal the flaws in this fragile Manchester United side.
First, Antonio rose high to power home Payet's cross before Reid headed in another delivery from the Frenchman, though David de Gea got a strong hand to it and should have kept it out.
One last thunderous farewell
There were disgraceful scenes outside Upton Park when the late arrival of Manchester United's team bus was greeted by a mass of West Ham fans who threw bottles at the bus and caused damage.
Inside, the old stadium staged one last hurrah that demonstrated the support and hostility that make it such a special arena - and showed why West Ham will find it almost impossible to recreate this potent combination at the Olympic Stadium.
There were moving scenes before kick-off as a band played Abide With Me as the names and faces of West Ham's departed greats flashed up on the big screens, with the greatest applause inevitably being reserved - at its conclusion - for England World Cup-winning captain Bobby Moore.
The game itself was played out in a cauldron, a cacophony of noise resounding around Upton Park for the entirety of a thrilling game.
There were some moments when those inside did not cover themselves in glory, keeping the ball from visiting goalkeeper De Gea, which ironically led to the move that brought Martial's equaliser and then when a fan emerged from the Bobby Moore Stand and got close to the Spain goalkeeper, taunting him before he was dragged away by stewards.
A fitting end for excellent West Ham
The Hammers wanted to end the Upton Park era with a performance worthy of the old place - and they went out with a bang, producing an outstanding display which hinted at rich promise for what lies ahead.
Slaven Bilic's side dominated for long spells, playing exciting, fluent football that provided a constant threat.
The Croatian may not have been West Ham's first choice but he has proved charismatic, astute and someone with a sure touch when it comes to knowing what this club means and demands.
He was in touch with the emotions of the occasion in the closing moments, tie and jacket discarded as he inspired his team to victory, looking almost moved to tears at the end.
West Ham remain on course for the Europa League at the end of a fine season - a deserved reward to take to the Olympic Stadium.
Man of the match - Mark Noble
The stats you need to know
- West Ham have scored in each of their past 12 Premier League games, their longest scoring run in the competition.
- The Red Devils managed just one shot in total in the first half - only against Manchester City on 25 October did they produce fewer this season in the Premier League.
- Anthony Martial now has 17 goals in all competitions for Manchester United this season, three more than any other player (Rooney 14).
- The Red Devils scored with their first two shots on target of the game.
- Since making his Premier League debut in August 2011, Manchester United midfielder Juan Mata has provided 40 assists, a haul only Manchester City forward David Silva (50) can better.
- Dimitri Payet has been involved in 11 goals in his past 12 Premier League appearances (scoring three, assisting eight).
West Ham are still in the hunt for a fifth-place finish. They are one point behind Manchester United and travel to Stoke on Sunday. Manchester United, meanwhile, host Bournemouth and must win to have a chance of finishing in the top four.
- 28LanziniSubstituted forObiangat 84'minutes
- 27PayetSubstituted forE Valenciaat 90+1'minutes
- 15SakhoSubstituted forTomkinsat 85'minutes
- 9CarrollBooked at 69mins
- 11E Valencia
- 1de Gea
- 25A ValenciaBooked at 70minsSubstituted forJanuzajat 87'minutes
- 28SchneiderlinSubstituted forCarrickat 45'minutes
- 21HerreraBooked at 75minsSubstituted forLingardat 83'minutes
- 9MartialBooked at 58mins
- Mike Dean
- Shots on Target
Second Half ends, West Ham United 3, Manchester United 2.
Foul by Chris Smalling (Manchester United).
Andy Carroll (West Ham United) wins a free kick in the attacking half.
Substitution, West Ham United. Enner Valencia replaces Dimitri Payet.
Foul by Anthony Martial (Manchester United).
Mark Noble (West Ham United) wins a free kick in the defensive half.
Substitution, Manchester United. Adnan Januzaj replaces Antonio Valencia.
Attempt missed. Cheikhou Kouyaté (West Ham United) with an attempt from the centre of the box is too high. Assisted by Dimitri Payet with a cross following a set piece situation.
Foul by Jesse Lingard (Manchester United).
Mark Noble (West Ham United) wins a free kick on the left wing.
Substitution, West Ham United. James Tomkins replaces Diafra Sakho.
Substitution, West Ham United. Pedro Obiang replaces Manuel Lanzini.
Substitution, Manchester United. Jesse Lingard replaces Ander Herrera.
Offside, Manchester United. Marcos Rojo tries a through ball, but Anthony Martial is caught offside.
Goal! West Ham United 3, Manchester United 2. Winston Reid (West Ham United) header from the centre of the box to the bottom right corner. Assisted by Dimitri Payet with a cross following a set piece situation.
Foul by Antonio Valencia (Manchester United).
Aaron Cresswell (West Ham United) wins a free kick on the left wing.
Goal! West Ham United 2, Manchester United 2. Michail Antonio (West Ham United) header from the centre of the box to the top right corner. Assisted by Dimitri Payet with a through ball following a set piece situation.
Attempt blocked. Dimitri Payet (West Ham United) right footed shot from outside the box is blocked.