Match ends, West Ham United 1, Swansea City 4.
West Ham United 1-4 Swansea City
West Ham's hopes of Champions League football took a severe knock as Swansea put four past them in Upton Park's final Saturday game.
Wayne Routledge poked home Kyle Naughton's low cross against the run of play to give the visitors the lead.
Andre Ayew doubled the lead from Stephen Kingsley's cross, and Ki Sung-yueng put the result beyond doubt.
Diafra Sakho netted a consolation before substitute Bafetimbi Gomis added Swansea's fourth.
It was an uncharacteristically limp home performance from Slaven Bilic's side, and with Manchester United victorious earlier in the day, their chances of a top-four finish now appear remote.
Swansea's fine form since Francesco Guidolin's appointment continues and they climb two places to 11th, with a chance to finish in the top half if they win their final game against Manchester City.
Guidolin guiding Swansea up the table
When Guidolin was appointed in January, Swansea were 18th and relegation appeared a very real possibility.
Many were sceptical about the ability of a manager with no experience of English football to turn around the perilous situation, but the Italian has now overseen eight wins from his 16 league games with the Welsh club.
And this was perhaps the most impressive of the lot, as he made six changes from the side that beat Liverpool - resting such influential players as Ashley Williams and Gylfi Sigurdsson - but still inflicted only a third home defeat of the season on West Ham.
"The manager has done brilliantly since he came in - all credit to him and his staff," said midfielder Jack Cork. "We've completely changed it around and people won't be looking at us and saying we've had a bad season."
Guidolin's contract is up next week but the 60-year-old refused to confirm whether he would be in charge next season, saying: "I am tired of answering questions."
Antonio unravels as Champions League dream fades
Bilic's heaviest home league defeat as West Ham manager could largely be traced to his ongoing ploy of playing Michail Antonio - a midfielder by trade - at right-back.
Antonio has made some significant attacking contributions since being moved into the back four, but here his defensive deficiencies were brutally exposed, as he was at fault for each of Swansea's first three goals.
First he was caught far too high up the pitch as Ki made a run down the left and crossed for Naughton, who centred for Routledge.
Then he allowed Kingsley to scorch past him before the left-back delivered a superb cross that Ayew converted from close range.
Finally, he was embarrassed by Modou Barrow's clever turn, which allowed the winger to find Ki on the edge of the area, from where the South Korean produced an assured finish.
This was surely a performance to convince Bilic that the 26-year-old does not have a long-term future at the back.
Man of the match - Ki Sung-yueng
What they said
West Ham manager Slaven Bilic: "What went wrong? Well, we started well for 20 minutes - it was like we were on fire, with the whole game being played in front of the Swansea goal. But Swansea have players who are capable of hurting you, and from nothing we conceded the first and second goals. We started losing out on balls in the middle of the park.
"I'm not that disappointed with our play with the ball, but without the ball we had too many passengers, relying on someone else to get the ball and play it to me in a good position.
"The bottom line is Swansea deserved it, and it's been a shock for us. We had a chance to qualify for the Champions League, but I have always said the gap I was focused on was the smaller one below us with Southampton and Liverpool. We really want to finish as high as possible and to achieve that we have to react in these final two games."
Swansea manager Francesco Guidolin: "I am very happy for my players, and I am very, very happy because we played very well.
"West Ham started very strongly and it was very difficult for us, but I don't think they played with pressure because West Ham's season has been very good. They are one of the best teams in the league this year.
"Our season is not finished and my team is not on the beach. We showed this in recent weeks against both Liverpool and now West Ham, and I hope also against Manchester City."
The stats you need to know
- Swansea City scored more than three goals in an away Premier League game for the first time since August 2012 vs QPR (5-0).
- Andre Ayew has scored as many goals in his past two Premier League games (3) as he had in his previous 21 combined.
- Ki Sung-yueng scored his first league goal since Boxing Day 2015, ending a run of 11 games without a goal for the Swans.
- West Ham ended a run of seven straight games in which they had scored at least twice.
West Ham play Manchester United on Tuesday in the Boleyn Ground's final game, while Swansea's final match against Manchester City takes place next Sunday.
- 2ReidBooked at 81mins
- 21OgbonnaBooked at 85mins
- 8KouyatéSubstituted forEmenikeat 77'minutes
- 20MosesSubstituted forSakhoat 59'minutesBooked at 72mins
- 28LanziniSubstituted forE Valenciaat 84'minutes
- 11E Valencia
- 4Ki Sung-yueng
- 58BarrowSubstituted forRangelat 70'minutes
- 10A AyewSubstituted forBrittonat 90+4'minutes
- 15RoutledgeSubstituted forGomisat 82'minutes
- Michael Oliver
- Shots on Target
Second Half ends, West Ham United 1, Swansea City 4.
Substitution, Swansea City. Leon Britton replaces André Ayew.
Goal! West Ham United 1, Swansea City 4. Bafétimbi Gomis (Swansea City) right footed shot from the centre of the box to the bottom left corner. Assisted by André Ayew following a fast break.
Corner, West Ham United. Conceded by Federico Fernández.
Attempt blocked. Dimitri Payet (West Ham United) right footed shot from the left side of the box is blocked.
Mark Noble (West Ham United) wins a free kick in the defensive half.
Foul by Bafétimbi Gomis (Swansea City).
Corner, Swansea City. Conceded by Darren Randolph.
Attempt saved. Kyle Naughton (Swansea City) right footed shot from outside the box is saved in the bottom right corner. Assisted by Ki Sung-yueng.
Corner, West Ham United. Conceded by Jordi Amat.
Corner, Swansea City. Conceded by Michail Antonio.
Angelo Ogbonna (West Ham United) is shown the yellow card for a bad foul.
Foul by Angelo Ogbonna (West Ham United).
Bafétimbi Gomis (Swansea City) wins a free kick in the attacking half.
Substitution, West Ham United. Enner Valencia replaces Manuel Lanzini.
Emmanuel Emenike (West Ham United) wins a free kick in the defensive half.
Foul by Leroy Fer (Swansea City).
Substitution, Swansea City. Bafétimbi Gomis replaces Wayne Routledge.
Winston Reid (West Ham United) is shown the yellow card for a bad foul.
Foul by Winston Reid (West Ham United).
André Ayew (Swansea City) wins a free kick on the left wing.
Corner, West Ham United. Conceded by Federico Fernández.
Attempt blocked. Diafra Sakho (West Ham United) right footed shot from the centre of the box is blocked. Assisted by Dimitri Payet.
Corner, West Ham United. Conceded by Jack Cork.
Attempt blocked. Diafra Sakho (West Ham United) right footed shot from outside the box is blocked. Assisted by Andy Carroll.
Substitution, West Ham United. Emmanuel Emenike replaces Cheikhou Kouyaté.
Attempt missed. Leroy Fer (Swansea City) left footed shot from outside the box is too high. Assisted by Wayne Routledge.
Diafra Sakho (West Ham United) is shown the yellow card for a bad foul.
Foul by Diafra Sakho (West Ham United).
Angel Rangel (Swansea City) wins a free kick in the defensive half.
Attempt blocked. Federico Fernández (Swansea City) right footed shot from the centre of the box is blocked. Assisted by Jordi Amat.
Corner, Swansea City. Conceded by Winston Reid.
Attempt blocked. André Ayew (Swansea City) right footed shot from the centre of the box is blocked.
Attempt blocked. Kyle Naughton (Swansea City) right footed shot from the right side of the box is blocked. Assisted by Leroy Fer.
Substitution, Swansea City. Angel Rangel replaces Modou Barrow.
Attempt blocked. Manuel Lanzini (West Ham United) right footed shot from outside the box is blocked. Assisted by Dimitri Payet.
Own Goal by Stephen Kingsley, Swansea City. West Ham United 1, Swansea City 3.
Attempt saved. Diafra Sakho (West Ham United) right footed shot from very close range is saved in the centre of the goal.
Attempt saved. Michail Antonio (West Ham United) header from the centre of the box is saved in the centre of the goal. Assisted by Dimitri Payet with a cross.