Goals from Cody Gakpo and Joel Matip clinched a comeback victory for Liverpool at West Ham, who had led early on through Lucas Paqueta.
The Brazilian midfielder opened the scoring inside 12 minutes at the London Stadium, rounding off a fine Hammers’ move that he had started.
But David Moyes’ side were quickly pegged back by Gakpo’s long-ranger, before Matip’s second half header proved enough for a 2-1 victory.
Liverpool made most of the running in the capital, with Mo Salah and Gakpo seeing early efforts blocked in an extraordinarily open start to the game.
But it was West Ham who struck the first blow, Paqueta rounding off a fine team move to smash past Alisson via a slight deflection. That goal lit the blue touch paper, as the London Stadium erupted, but Liverpool found a rapid response through Gakpo, who was given time to pick his spot from just outside the box and made it 1-1.
Jurgen Klopp’s side dominated the rest of the first half, with Diogo Jota twice going close to clinching the lead, but couldn’t find the goal.
Jarrod Bowen thought he’d scored it just before the hour mark after West Ham made a strong start to the second half, but his effort was disallowed by VAR for offside.
Liverpool then wrestled back the initiative when Klopp introduced Luis Diaz and Thiago Alcantara and they went ahead through Matip, who scored a bullet header from Andy Robertson’s corner.
The win, Liverpool’s third on the bounce, keeps alive their slim hopes of a top four finish, while West Ham remain on 34 points – just short of the likely figure required for guaranteed safety from relegation.