Liverpool suffered very late FA Cup heartbreak at the Boleyn Ground as Angelo Ogbonna's header put West Ham into the fifth round of the competition, where they will meet Blackburn Rovers at Ewood Park.
Reds boss Jurgen Klopp made 10 changes to the side that threw away a two-goal lead at Sunderland at the weekend as he returned to work following surgery to have his appendix removed.
The first half saw the woodwork shaken on several occasions but the home side had the lead at the break thanks to Michail Antonio's well-taken strike.
As penalties loomed, Ogbonna popped connected with a wonderful header from Dimitri Payet's excellent delivery.
It wasn't all bad news for the Reds as the trio of Daniel Sturridge, Divock Origi and Coutinho all returned from injury, and there is the very small consolation of the fixture congestion easing slightly.
Simon Mignolet - Made a fine save from a Payet free-kick and the rebound that followed it. Could do little about either goal, but had his usual nervy moment when trying and failing to collect a high ball. - 5
Jon Flanagan - Not much else to be said apart from pretty solid. - 6
Tiago Ilori - Did some things well, knows when to stand a player up but he does look as if he can panic when put under some pressure. Lucky not to give away a penalty for a tug on Valencia. - 6
Lucas Leiva - He did a lot more talking than a lot of natural centre-backs have been doing this season, it's hard to really fault him, he'll think he was unlucky with the free kick - one of those that can go either way. Aggressive and positionally sound. - 8
Brad Smith - A constant threat going forward but, as would be the case with Alberto Moreno, but a question needs to be asked about his role in opener. He tired as the game went on. - 6
Kevin Stewart - He started off a lot of moves that got Liverpool on the front foot. His inexperience showed at times, but that's to be expected. Overall, he impressed again - 7
Pedro Chirivella - His first start for the first team and certainly wasn't shy. Was keen to keep the tempo high, always showed for the ball, wasn't afraid to try the killer pass either - 6
Joao Carlos Teixeira - Looked to link up well with Coutinho and found space, though should've scored in the first half - 6
Jordon Ibe - His influence on the game dwindled a little when moved inside, looks more comfortable wide but needs to brush up on his technique. - 5
Philippe Coutinho - Hit the post and linked up very well with Smith on the left. Clever free-kick to equalise. A decent way to return to the side - 8
Christian Benteke - Odd one, a constant threat if he does the right thing, arguably unlucky not to get a goal from first half corners, or get an assist after providing for Coutinho whose shot hit the post, but has to bury one of those chances in extra time. The positive is he actually looked a threat but will get lynched because he's not scoring - 5
Daniel Sturridge - Showed signs of linking up well with Benteke and he, along with others, put West Ham on the back foot a little soon after his introduction, and nearly profited in extra time. Here's hoping it's the first of a decent run of games for him - 6
Divock Origi - A tricky opponent to face on the flank and not lost any of that confidence found prior to his injury. The main thing is he's back and Liverpool have those options up front - 6
James Milner - Hard to really rate him given he clearly came on to give Liverpool more legs in place of Chirivella, and take a penalty if it got that far - N/A