City’s record run in the competition came to an end at the London Stadium as the Hammers emerged 5-3 winners from a penalty shootout after both sides were guilty of missing plenty of chances in a 0-0 draw.
Phil Foden was the only man to miss from the spot as Mark Noble, Jarrod Bowen, Craig Dawson, Aaron Cresswell and Said Benrahma all found the net for David Moyes’ men.
Pep Guardiola characteristically named a strong side and will feel City should have continued their run of 21 League Cup games without defeat.
Nathan Ake, John Stones, Ilkay Gundogan and Raheem Sterling all wasted big opportunities as the scoreline belied a contest which raged from one end to the other.
Tomas Soucek also side-footed wide two big chances to win the game for the hosts.
Foden was thrown on along with Jack Grealish in an attempt to win the game from Guardiola.
But the England international pulled City’s first penalty wide and stand-in goalkeeper Zack Steffen could not bail his teammate out despite getting a hand to Bowen and Benrahma’s strikes.
Liverpool will now fancy their chances of winning the League Cup for the first time in nine years, but had to overcome a poor start to win 2-0 at Preston.
The Reds had scored 30 goals in eight previous away games this season, but a much-changed side from Jurgen Klopp failed to hit the heights of Sunday’s famous 5-0 win at Manchester United.
Preston had by far the better of the first-half as Adrian made a point-blank save from Sean Maguire, Neco Williams cleared off the line and Brad Potts fired over within a matter of seconds.
Liverpool were clinical as they went in front with their first shot on target just after the hour mark as Williams’ cross was acrobatically flicked home by Takumi Minamino.
Klopp’s men then controlled the final half hour and doubled their lead in spectacular fashion when Divock Origi’s backheel dinked the ball over Delcan Rudd.
Tottenham’s bid for a first trophy since they last won the League Cup in 2008 remains on course as Nuno Espirito Santo was rewarded for naming a strong side with a 1-0 win at Burnley.
Lucas Moura scored the only goal 22 minutes from time with a powerful downward header from Emerson Royale’s cross.
Leicester also needed penalties to see off Brighton after an entertaining game ended 2-2.
The Foxes twice pounced on Brighton gifting possession away in dangerous areas to take the lead through Harvey Barnes and Ademola Lookman in the first-half.
Adam Webster and Enock Mwepu levelled for the Seagulls, but Mwepu and Neal Maupay failed to beat Danny Ward from the spot.
Brentford reached the last eight for the second consecutive season with a 2-1 win at Stoke thanks to first-half goals from Sergi Canos and Ivan Toney.