Darwin Nunez scored a fine goal as Liverpool saw off West Ham to extend their unbeaten run to 18 games in all competitions.
Mohamed Salah gave Liverpool the lead against the run of play with a penalty after he was brought down by Nayef Aguerd.
Jarrod Bowen levelled for West Ham with an excellent stooping header to meet Vladimir Coufal’s cross.
Soon after Curtis Jones had a goal ruled out for Liverpool for offside.
Nunez put them ahead with a difficult hooked volley from Alexis Mac Allister’s clipped ball over the top.
The Hammers played well in stages but never created a clear-cut chance to equalise.
And Diogo Jota sealed the points when he pounced from close range to turn home Virgil van Dijk’s header.
West Ham boss David Moyes has now lost 24 Premier League games against Liverpool, a joint record for a manager against one team, level with Harry Redknapp against Manchester United.