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.
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.