Liverpool were cruelly eliminated from the FA Cup on Tuesday night as a goal in the final seconds of extra-time gave West Ham United a 2-1 win in the fourth-round replay.

The Hammers initially went in front in the closing moments of the first half as Michail Antonio volleyed in, but a response was served by the Reds immediately after the break through a brilliantly-placed free-kick by Philippe Coutinho.

Jürgen Klopp’s men exerted more control on the game as it wore on and had chances to secure the crucial second, only for Angelo Ogbonna to grab it for the home side instead with a last-gasp header.

When the teamsheets were delivered before kick-off, the name of Coutinho stood out on Liverpool’s – the influential Brazilian returned to the starting XI for the first time since January 5.

Klopp also handed the likes of Pedro Chirivella, Tiago Ilori, Brad Smith, Kevin Stewart and Joao Carlos Teixeira another chance to impress at first-team level, while Lucas Leiva wore the captain’s armband.

Both sides made a lively start to the game, though 14 minutes had passed before either goalkeeper was worked. Coutinho’s deep corner reached Christian Benteke and the No.9 connected with it well but was thwarted by the body of Hammers stopper Darren Randolph.

The hosts went even closer moments later. With Liverpool’s defence drawn across to one side, Dimitri Payet picked out Joey O’Brien in the opposite direction and only a crucial deflection by Lucas ensured his strike struck the near post rather than the net.

Slaven Bilic’s team were showing the kind of confidence that has inspired their impressive season, and backed by a noisy home crowd, but the Reds soon created a string of promising chances at the other end.

Teixeira drove a low effort just wide of goal from the centre, and Coutinho and Benteke then combined on the counter-attack and fast footwork by the latter on the byline teed up the former to clip a left-footer against Randolph’s near post.

The ‘keeper himself denied Benteke within seconds, blocking the striker’s back-post header from a carbon-copy Coutinho corner in, while Simon Mignolet may have got fingertips on Payet’s free-kick as it curled onto the woodwork.

But Liverpool fell behind in the final minute of the half. West Ham switched the ball from left to right and Antonio, unmarked at the back post, promptly smashed a volley into the back of the net for the opener.

Klopp’s charges were out particularly early for the second period and whatever the manager said during the interval had an immediate impact, as they were level within three minutes.

A foul on Benteke at the edge of the box set up a shooting opportunity and Coutinho took control to equalise with a touch of class, deceiving both the wall and Randolph with a subtle, low finish into the left corner.

The Reds were visibly lifted and Pedro Obiang had to make an important block to prevent Benteke from putting his team ahead after Smith’s determination to run in behind had caused a scramble in front of goal.

Klopp sought to build on the shift in momentum with a double substitution, involving the welcome sight of both Divock Origi and Daniel Sturridge returning to action. Coutinho and Teixeira were the men withdrawn.

A frantic nature developed in the tie as time ticked by and Bilic threw former Liverpool forward Andy Carroll into the equation with a quarter of an hour remaining – Cheikhou Kouyate going off due to an injury.

Benteke brought a diving save out of Randolph with a free-kick from a similar position to Coutinho’s earlier goal, while Enner Valencia misjudged a headed chance from Payet’s cross and nodded over the bar.

Eight additional minutes at the end of the 90 offered potential for a grandstand finish – and Jordon Ibe went close with a left-footer across goal which the ‘keeper was alert to stop – but extra-time was required.

The Hammers were rejuvenated at the outset and Mark Noble shaped a curler from 20 yards that Mignolet palmed away, though it was the Reds who really threatened with two great chances in the following minutes.

Both came to Benteke, the first a volley he dragged wide to the left after waiting to connect with a dropping ball and the second a one-on-one with Randolph ultimately won by the latter as he saved with his legs.

Into the second period of extra-time, Sturridge was a whisker away from putting Liverpool ahead when he collected James Milner’s pass forward and prodded a rising strike narrowly beyond the upright.

A penalty shootout loomed and looked a certainty until Payet swung in another free-kick in stoppage-time and Ogbonna climbed highest to head across Mignolet into the corner and leave the Reds disappointed.