Swansea City halted West Ham's 10-match unbeaten run with a 4-1 Premier League victory in the penultimate fixture at Upton Park, all-but ending any hope of a top-four finish for Slaven Bilic's men.
A win would have pulled West Ham within two points of fourth-placed Manchester City with two matches left to play and one behind Manchester United, who beat Norwich City earlier on Saturday and visit the Boleyn Ground on Tuesday.
However, first-half goals from Wayne Routledge and Andre Ayew, along with a 51st-minute volley from Ki Sung-yueng left the Hammers stunned, and the home side could only muster a Stephen Kingsley own goal in response before Bafetimbi Gomis struck Swansea's fourth in injury time.
Only the top six are currently guaranteed a place in next season's Europa League and, with Southampton and Liverpool - who have a game in hand - two and four points behind respectively, West Ham's priority will now be to fend off the challenge of the chasing pack.
For Swansea, the result represents a first win at West Ham since 1956 and lifts them within two points of the top half of the table after a difficult season.
West Ham started brightly and Dimitri Payet tested Lukasz Fabianski with an early curling effort that was tipped behind by the Polish goalkeeper, who made another save to deny Winston Reid from the resulting corner.
Swansea, sporting six changes from the side that secured Premier League safety with a 3-1 win over Liverpool last weekend, offered little going forward as West Ham continued to have the upper hand, and Payet had Fabianski scrambling again with two free-kicks that narrowly missed the target.
However, it was the visitors who eventually took the lead against the run of play after 25 minutes.
Ki spread the ball to Kyle Naughton in acres of space on the right wing and the full-back squared for Routledge to tap home.
Swansea continued to find space down the right and Routledge sent in an inviting cross for Ki, who failed to find a way past Darren Randolph - in for the injured Adrian.
It was on the left wing that Swansea's second was crafted, though, as Kingsley surged down the flank before finding Ayew with a superb cross, leaving the Ghana international with a simple finish.
Andy Carroll fired across the face of goal from a right-wing cross on the stroke of half-time, with Manuel Lanzini lifting over from close range before referee Michael Oliver blew his whistle, but Swansea stretched their lead further early in the second period.
Modou Barrow created space on the left and teed up Ki to place a volley beyond Randolph and put the result beyond reasonable doubt.
Michail Antonio fired straight at Fabianski and Carroll fizzed an effort just wide of the target as West Ham looked to conjure some form of response, and Diafra Sakho came off the bench to force the ball over the line after two reaction saves from the Swansea goalkeeper, although Kingsley was credited with making the final touch.
Gomis' deflected strike then bounced off the top of the crossbar before he rounded off the scoring with the home defence outnumbered in the closing stages.