Late goals by Angelo Ogbonna and Michail Antonio sealed a 3-1 win over West Bromwich Albion to edge West Ham United closer to UEFA Europa League football next season.
West Ham made a bad start to the match as Declan Rice missed a penalty before Matheus Pereira gave West Brom a 27th-minute lead, scoring directly from a corner for his sixth goal in eight matches.
But Tomas Soucek equalised in first-half stoppage time when he tapped in Said Benrahma's low cross at the far post.
Aaron Cresswell then struck a post before the left-back's corner kick set up Ogbonna to put West Ham ahead on 82 minutes.
Antonio added a third on the counter-attack with two minutes left after being played in by Jesse Lingard.
It means West Ham need only a point at home to Southampton on Sunday to guarantee a sixth-placed finish.
Relegated West Brom stay 19th on 26 points and have announced Sam Allardyce will step down from his position as head coach at the end of the season.
See: West Brom report | West Ham report
Next fixtures
West Brom: 23 May v Leeds (A)
West Ham: 23 May v Southampton (H)
Match officials
Referee: Michael Oliver. Assistants: Stuart Burt, Lee Betts. Fourth official: Darren England. VAR: Jarred Gillett. Assistant VAR: Stephen Child.
WHO'S GOING TO BE YOUR
MAN OF THE MATCH?
Vote at Full-time