Match ends, Liverpool 3, West Ham United 2.
Liverpool survived a rare night of struggle in this stellar season to overcome West Ham United and close to within four wins of the Premier League title as keeper Lukasz Fabianski suffered an Anfield nightmare.
Victory means Liverpool equal the English top-flight record of 18 successive wins, set by Manchester City from August to December 2017, with Jurgen Klopp's side last dropping points in a 1-1 draw with Manchester United in October.
The Hammers - whose fans staged protests against the club's owners throughout - threatened to inflict Liverpool's first league defeat this term when they led midway through the second half.
Liverpool took an early lead when Fabianski failed to deal with a routine Georginio Wijnaldum header but David Moyes' side showed great character to hit back through Issa Diop's header, which should also have been kept out by Alisson.
And when substitute Pablo Fornals swept West Ham into the lead nine minutes after the break Liverpool were faced with a fight to preserve their unbeaten 27-match league run.
It had been a poor display by their sky-high standards but their luck was in as Fabianski was the culprit again, inexplicably allowing Mohamed Salah's shot to squirm through his legs in the 68th minute.
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.
It was cruel on West Ham and Moyes, with Liverpool keeper Alisson having to produce a crucial late block from substitute Jarrod Bowen.
Liverpool have restored their 22-point lead at the top and the Hammers are left in the bottom three.
- Football Daily podcast: West Ham come close to bursting Liverpool's 'invincible' bubble
- When and where can Liverpool win the title?
- Klopp thought matching winning record was impossible
- Relive Liverpool's victory over West Ham
Liverpool find a way again
Liverpool have produced months of thrilling football but this inevitable title triumph has also been about winning with narrow margins when just short of their best.
The champions-elect were a long way short of that here and the decisive moment in this match was when Fabianski, who has been a reliable figure for West Ham, compounded his error for Wijnaldum's goal with a horror moment as Salah's shot slipped through his legs and into the net in front of an exultant Kop.
Liverpool missed the driving force and leadership of injured captain Jordan Henderson and it was no surprise when Naby Keita was substituted after a poor performance.
The great quality of this Liverpool side, and make no mistake they got lucky with Fabianski's howlers, 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.
Liverpool's celebrations were subdued at the final whistle, perhaps an acknowledgement of an average display - but this will not matter when in due course they are crowned champions for the first time in 30 years.
West Ham can take heart
Moyes must feel Anfield holds him in a curse - he has never won at Anfield in 16 attempts as a manager with Everton, Manchester United, Sunderland or West Ham.
The Scot's joyous celebrations when Fornals gave West Ham the lead at a time his side were performing with real heart must have had him believing the drought might be over until things took a nasty twist with that Fabianski error.
West Ham's fans came here to protest against their owners, with black balloons let off and a series of banners unfurled reading "Karren Brady - You're Fired. "Sullivan This Charmless Man." "Run Like A Circus Owned By Clowns" and "State Of The Art Retractable Promises."
If there was discontent off the field, they will have been pleased with what they saw on it as West Ham ran Liverpool as close as just about anyone at Anfield this season.
Moyes still faces an uphill struggle but he can at least take some encouragement from West Ham's display once the bitter taste of defeat has eased.
A bad record for Moyes - the best of the stats
- West Ham manager David Moyes remains without an away win against Liverpool in all competitions, failing in 16 attempts (D7, L9) and losing the last four in a row with Man Utd, Sunderland and West Ham.
- Liverpool have won their last 21 home Premier League games, equalling the English top-flight record for consecutive home wins, set by the Reds themselves between January and December 1972 under Bill Shankly.
- They have scored 14 headed goals in the Premier League this season, more than any other side.
- Only Cesc Fabregas (20y 134d) and Wayne Rooney (21y 63d) have reached 25 Premier League assists at a younger age than Liverpool's Trent Alexander-Arnold (21y 140d).
- Since making his debut for West Ham in February 2017, Robert Snodgrass has registered 12 assists in the Premier League for the Hammers, more than any other player.
- Mohamed Salah has been directly involved in eight goals in six Premier League appearances against West Ham (6 goals, 2 assists).
- Since his Premier League debut in August 2014, Liverpool's Andrew Robertson has registered 27 assists in the competition, more than any other defender in that time.
- Sadio Mane has been directly involved in eight goals in his last six Premier League appearances against West Ham (5 goals, 3 assists), scoring in each of his last four against the Hammers.
Man of the Match - Trent Alexander-Arnold
'I never thought it would be equalled' - what they said
Liverpool boss Jurgen Klopp speaking to Sky Sports: "I liked a lot how we started. We scored a wonderful first goal. But then we weren't good in second ball situations. We have to pick them up much more often. We struggled in this situation and that gave West Ham a good feeling.
On equalling Manchester City's record winning run: "I never thought it would be broken or equalled. We did it and I cannot believe it happened to be honest. I like a lot tonight that everything positive helps. When we equalised the stadium was rocking and that helps us. Whatever will happen this season is an effort of all of us. I could not be more thankful or appreciate the support we get. So far so good."
West Ham manager David Moyes on BBC Radio 5 Live: "We can take a lot of positives. Before the game nobody will have given us a great deal of hope. I thought for large periods of the game we had a chance.
"I'd hate to think my teams would do anything but put a lot of effort in and I'd be annoyed if anyone else thought otherwise. The disappointing thing is the individual mistakes. I thought tonight we did a really good job. We performed really well as a team but we go away with no points and it's the points we need.
Liverpool travel to Watford on Saturday, 29 February (17:30 GMT kick-off), while West Ham host Southampton on the same day (15:00 GMT kick-off).
- 4van Dijk
- 8KeitaSubstituted forOxlade-Chamberlainat 57'minutes
- 10ManéSubstituted forMatipat 90+1'minutes
- 23DiopBooked at 66mins
- 41RiceBooked at 51mins
- 28SoucekSubstituted forFornalsat 47'minutes
- 11SnodgrassSubstituted forBowenat 84'minutes
- 16NobleBooked at 80mins
- 8Felipe AndersonSubstituted forHallerat 65'minutes
- Jonathan Moss
- Shots on Target
Second Half ends, Liverpool 3, West Ham United 2.
Corner, West Ham United. Conceded by Georginio Wijnaldum.
Attempt blocked. Mark Noble (West Ham United) right footed shot from outside the box is blocked.
Foul by Joel Matip (Liverpool).
Michail Antonio (West Ham United) wins a free kick on the left wing.
Substitution, Liverpool. Joel Matip replaces Sadio Mané.
Sadio Mané (Liverpool) wins a free kick in the attacking half.
Foul by Jeremy Ngakia (West Ham United).
Attempt missed. Aaron Cresswell (West Ham United) left footed shot from the centre of the box is high and wide to the right following a corner.
Corner, West Ham United. Conceded by Alisson.
Attempt saved. Jarrod Bowen (West Ham United) left footed shot from the left side of the box is saved in the centre of the goal. Assisted by Michail Antonio with a through ball.
GOAL OVERTURNED BY VAR: Sadio Mané (Liverpool) scores but the goal is ruled out after a VAR review.
Offside, Liverpool. Trent Alexander-Arnold tries a through ball, but Sadio Mané is caught offside.
Substitution, West Ham United. Jarrod Bowen replaces Robert Snodgrass because of an injury.
Goal! Liverpool 3, West Ham United 2. Sadio Mané (Liverpool) right footed shot from very close range to the centre of the goal. Assisted by Trent Alexander-Arnold.
Attempt blocked. Joseph Gomez (Liverpool) left footed shot from outside the box is blocked.
Mark Noble (West Ham United) is shown the yellow card for a bad foul.
Alex Oxlade-Chamberlain (Liverpool) wins a free kick on the right wing.
Foul by Mark Noble (West Ham United).