Liverpool captain was close to costing his team against , only to respond with a last-gasp winner. Luis Diaz's tap-in had put the hosts in front, but put through his own net after a mix-up involving Van Dijk before the captain headed home from a corner.
Diaz opened the scoring early on, tucking the ball home after slid the ball across. The Reds had a big scare moments later, though, with Mohammed Kudus lifting the ball over Alisson but seeing his effort come back off the bar.
The visitors grew in confidence in the second half, creating plenty of chances. Were it not from , who stayed tall to deny after West Ham's captain beat the offside trap, it might have been all square going into the final quarter of the game.
The reverse fixture in December was one-way traffic, with Liverpool running out 5-0 winners. They also put five past the Hammers in the Carabao Cup, but Graham Potter's first trip to Anfield as Hammers boss was a closer-run thing.
The visitors got the goal they deserved - albeit in bizarre circumstances - when Virgil van Dijk's attempted clearance came off Robertson and found the net. Diaz struck the bar moments later as Liverpool looked to retake the lead, but it was Van Dijk who proved the hero.
READ MORE:
READ MORE:
After Diaz's opener, Dinos Mavropanos had a golden chance to equalise on the stroke of half-time, only to plant a free header over the Reds' bar. The league leaders almost punished West Ham within moments of the restart, though, with Alexis Mac Allister hitting the bar with a free-kick.
A few minutes later, Mac Allister almost got the better of Hammers keeper Alphonse Areola in bizarre circumstaces, with a wayward cross needing tipping over the crossbar. While it was 1-0, though, the visitors still fancied their chances and came close when Carlos Soler got into a good position but couldn't keep his shot down.

West Ham continued to push forward in the final half-hour and the equaliser was their just reward, only for Van Dijk to have the last word - though there was still time for the woodwork to bail out the hosts as Niclas Fullkrug went close. Here are Mirror Football's talking points from a nervy afternoon at Anfield.
1. Van Dijk comes up trumpsVirgil van Dijk has been a key man for Liverpool this term, but his role in the equaliser was a forgettable one. The skipper is usually a great communicator, but he and Robertson got it all wrong.
It was perhaps for this reason that the Dutchman felt the onus to step up in the closing stages. His header was powerful, precise and decisive, and it broke Hammers hearts.
Liverpool are still hopeful their captain will commit his future to the club with a contract extension. When we see the end-of-season montages, his header will surely have a firm place.
2. Salah the record-breakerWhen had his first run at Ollie Scarles, about 90 seconds into the game, a huge roar went up from the home fans. The news of his contract extension is clearly a popular development, and he showed enough glimpses of why.
It took a bit of time for the Reds' top scorer to hit his groove, but he was inches away from opening the scoring after 16 minutes after cutting in from the right and flashing a shot just wide. Just two minutes later he had laid on the opener, with a low outside-of-the-boot ball finding Diaz at the back post.
Young defender Scarles tried to take things to Salah but had a torrid first half-hour attempting to keep the Egyptian under wraps and ultimately made way for the experienced Vladimir Coufal with Aaron Wan-Bissaka switching flanks. in a 38-game season with his early assist, and there's plenty of time to add to his tally.
3. Bradley gets a chance to impresshinted during the week that Conor Bradley had the ability to step up as a regular starter if , as expected, leaves this summer. “I think we can only judge Conor on his fitness if he is good enough, which I think he is, to become a regular starter for us,” .
The 21-year-old played the final quarter of the game at last weekend after returning from his latest injury setback. This time, though, he was deemed fit enough to start.
Bradley got forward well, supporting Salah in the Reds' attacks. He didn't complete the full 90, with Slot freshening things up as his team came under pressure, but he should have more opportunities to catch the eye between now and May.
4. Kudus still West Ham's danger-manMohammed Kudus looked like he was going to provide their best chance of scoring. Left-back has been an issue for in recent weeks, with Andy Robertson making way for Kostas Tsimikas this time around, and Kudus threatened down his side.

The first big chance came shortly after Liverpool's opener. The chance looked to have gone when Alisson rushed off his line to put off Carlos Soler, but Kudus showed ambition with an effort which might well have crept in on another day.
Later in the first period, the former Ajax star caught Tsimikas sleeping, but had drifted offside before firing into the legs of Alisson. Despite the close attentions of the league leaders, he didn't appear to tire and showed real quality in what has been a tricky season for West Ham on the whole.
5. Diaz lively as others flagWhile Salah has been Liverpool's leading man this term, Diaz has a case to be named their best supporting actor. Indeed, as others have begun to look tired in the latter stages of the season, the Colombian has kept his levels up.
The goal might have come from a straightforward finish, but he contributed throughout. A fine burst early in the second half might have led to something more with an extra bit of pace to keep the ball in play, as he caused problems for a defender in Wan-Bissaka who has kept top players quiet this term.
Moments after West Ham's equaliser, Diaz showed he had more to offer. If others are limping over the line, he certainly isn't.
6. Alisson settles nerves after Fulham reverseLiverpool's lead at the top of the is a healthy one, but last week's defeat at Fulham was a reminder of their fallibility. The most important thing right now is getting points on the board, though, and that's what they managed today.
Alisson wasn't involved at Craven Cottage, and stand-in was hardly at fault. Even so, having the best keeper in the league - and the Brazilian can make a strong case for that honour - can be all the difference you need.
West Ham threw plenty at Liverpool in the second half, but an own goal was their only way past Alisson. It's far from the first time he's bailed out his team-mates, be it in this title run or the last.
and receive your daily dose of Mirror Football content. We also treat our community members to special offers, promotions, and adverts from us and our partners. If you don't like our community, you can check out any time you like. If you're curious, you can read our
You may also like
ED issues fresh summon to Robert Vadra over Haryana land deal
Jaat BO: Sunny Deol's roar diminished in the first Monday test, 'Jaat' faltered on BO, earnings reduced to single digit..
Rashmika shares positivity-filled video after shooting for entire night
Female members of major biz groups get $351.5 mn in dividends in 2024: Data
"Thank you for the motivation": Salman Khan shares beefed up pics from gym, claps back at car blowing up threats