Shakespeare extended his 100 per cent record as a manager as the Premier League champions edged through 3-2 on aggregate after their 2-0 home win.
It was Leicester's fourth win from four games under Craig Shakespeare as they picked up their first away victory of the season.
A Manuel Lanzini free kick on 20 minutes brought the Hammers back into the game. We have to assess them next couple of days.
Manuel Lanzini briefly halved the deficit with a free-kick but they were booed off at half-time, and although Andre Ayew pulled another back after the break Leicester repelled a late rally to claim all three points. "To pull off those crucial saves was vitally important today".
West Ham were guilty of gifting Leicester two early goals, as their poor defending allowed the visitors to take the early initiative. You can see the rewards that come.
The West Ham defence were at fault as they were too slow to close down Leicester's Algerian playmaker, and goal keeper Darren Randolph, although unsighted, should have done better.
Wilfred Ndidi has been one of the few new signings to stamp his authority since joining this season, and the Nigerian global got another 90 minutes under his belt at the London Stadium on Saturday.
Robert Huth made it 2-0 when left totally unmarked to head home Marc Albrighton's cross.
Having conceded two soft goals, albeit with some extremely poor defensive play, West Ham finally came into the game and started to exert some pressure.
Despite their troubles this season Leicester are the only side yet to drop a point from a winning position, and Huth admitted their first away win has been a long time coming.
A smart interchange between Mahrez and Albrighton won Leicester a corner.
Kasper Schmeichel was in fine form between the sticks and his save from Carroll at the death was excellent, but the West Ham faithful felt that the 28-year-old let the Dane off the hook by putting the ball straight at him.
The Croatian expressed his frustration with another negative result for West Ham, as they are now on a five match winless streak.
Andy Carroll headed the set-piece back to Ayew, whose header had enough power to go through Schmeichel.