After taking the lead through Georginio Wijnaldum, the Hammers stormed back to take a 2-1 lead through Issa Diop and Pablo Fornals.
Mohamed Salah levelled the scores before Trent Alexander-Arnold got his second assist of the night to set up Sadio Mane for the winner.
Here is what the media made of the game...
Neil Jones, Goal.com
What was it Thanos said? “I am inevitable.” Liverpool must feel like that these days. Their presence looms large. Undeniable, irresistible, unstoppable. Admired, feared. You look at them and you marvel at them. They just keep doing it. How do they just keep doing it? And then you look at them and, for once, you doubt them and you wonder, could this be the one that trips them up, could this be the night? But deep down you know. They’ll win. They always do. West Ham came closer than most to stopping the juggernaut, but left as every other team has left Anfield this season. Beaten, 3-2 in this instance, and wondering just what they have to do to stop Klopp’s side. For a spell, David Moyes must have thought he was going to be the man. The Hammers stunned Anfield to equalise through Diop and then, improbably, to lead through Fornals, the substitute. Midway through the second half, they were on course to become the first team to beat the Reds in the league in 13 months, and the first to win here since April 2017. But 68 minutes is not a football match, 90 is. And Liverpool did what they have done so often; they found another gear, they put the pressure on and they got their rewards. The ultimate 90-minute team. The ultimate team.
Paul Gorst, Liverpool Echo
The Reds have now won 21 games on the spin at home, equalling a record that was set back in 1972. The skippering duties were handed to the peerless Virgil van Dijk. Here is a man whose imposing stature is only matched by his unshakable composure. The Dutchman turned in a trademark display of effortless brilliance to keep the Irons mostly at bay throughout. It might sound strange to suggest that on a night when the Reds conceded twice, but Van Dijk was head and shoulders above the other defenders on the pitch. Calls have grown and grown in recent weeks to make Jordan Henderson the PFA Players’ Player of the Year, but the current holder is perhaps having his uber-consistency held unfairly against him. This was Van Dijk’s 11th venture as Liverpool captain since his move from Southampton over two years ago. The Reds have won them all. Once more, Van Dijk has been the bedrock upon which everything has been built at Anfield this term. What a remarkable footballer the Reds have on their hands at centre-back.
Phil McNulty, BBC
Victory means Liverpool equal the English top-flight record of 18 successive wins, set by Manchester City from August to December 2017, with Klopp's side last dropping points in a 1-1 draw with Manchester United in October. There was a sense of inevitability as Liverpool went for victory and so it proved as Sadio Mane turned in with nine minutes left after Trent Alexander-Arnold lofted the ball over Fabianski. The great quality of this Liverpool side is that they are currently driven by an unshakeable self-belief and the error for Salah's goal tipped the balance firmly in their favour. It is a truly remarkable effort to have dropped only two points after 27 games and Liverpool will happily grab moments of good fortune when they can.
David Lynch, Evening Standard
Alex Oxlade-Chamberlain came off the bench and epitomised everything that was good about the hosts as they turned a 2-1 deficit into a 3-2 victory that extended their incredible start to the season. Along with Manchester City, Liverpool now jointly hold the record for consecutive Premier League wins (18). They also possess a 22-point lead at the top of the division that just about does justice to their dominance this term. But none of that would be possible were it not for Oxlade-Chamberlain, who single-handedly changed the dynamic of the match following his introduction.
This story has been reproduced from the media. It does not necessarily represent the position of Liverpool Football Club.