West Ham could miss out on a place in the Europa League after Stoke City came from behind to win 2-1 at the Britannia Stadium.
Michail Antonio’s 23rd-minute opener for the Hammers was cancelled out in the 55th minute by a Giannelli Imbula strike.
Diafra Sakho had squandered a great chance to make it 2-0 just before Imbula’s equaliser and a series of goal-line clearances subsequently stopped the visitors regaining the lead, with only inches in it on one occasion.
Potters substitute Mame Diouf then headed home with two minutes to go to wrap up a first victory in seven for his side, who finish the season in ninth place in the Barclays Premier League table, matching their final position in the last two campaigns.
West Ham finished seventh, and will only qualify for the Europa League if Manchester United beat Crystal Palace in the FA Cup final next weekend.
It has been a fine season for Slaven Bilic’s side – this was their second defeat in 13 league matches – and it will make for a cruel conclusion if they are denied the reward of playing European football at their new Olympic Stadium home next term.
With the opening stages lacking in real action, this contest had a distinctly end-of-term feel about it until West Ham suddenly went ahead in the 23rd minute.
A corner was flicked on by Winston Reid towards Antonio, who Stoke allowed too much space to control the ball, turn and fire in.
The goalscorer had done well, but certainly it appeared the Potters should have done better.
Ryan Shawcross blocked a Manuel Lanzini shot soon after, and with Stoke then once again ponderous, Antonio fired over and Sakho blasted wide.
West Ham kept up the tempo, with Cheikhou Kouyate next to try his luck, seeing a strike deflect over.
Stoke had constantly given the ball away and failed to build anything in attack, but they finally showed some threat in the 39th minute when Bojan Krkic drilled wide.
Soon after the break more Stoke sloppiness allowed West Ham to break forward and Antonio laid a chance on a plate for Sakho. Shay Given deserved credit for the save he made, but Sakho really should have buried the opportunity.
Four minutes later, the hosts capitalised on surviving that scare as Imbula collected the ball and cracked a low shot into the corner of the net from the edge of the box.
Stoke enjoyed some pressure thereafter, with Bojan shooting wide, before West Ham passed up another great chance as substitute Enner Valencia headed over.
A hectic period then saw Stoke clear the ball off the line a number of times in quick succession as West Ham caused chaos in their area.
The closest incident came when an effort from substitute Emmanuel Emenike was flicked on by Kouyate and Glenn Whelan made the clearance – replays showed the whole of the ball was very nearly over the line.
Stoke’s Charlie Adam then nearly repeated an old trick as his shot from the inside his own half brought a scrambling save out of Hammers goalkeeper Darren Randolph – and seconds later the midfielder’s corner was headed home by fellow substitute Diouf.