Leicester piled the pressure on beleaguered West Ham, with a 2-1 win sealing the fate of boss Manuel Pellegrini.
Reports ahead of kick-off suggested Pellegrini had two games - home matches against Leicester and Bournemouth - to save his job, but the Hammers confirmed his departure just hours after defeat to Brendan Rodgers' side.
Kelechi Iheanacho headed Leicester in front five minutes before the break and though the Hammers were handed a lifeline when Pablo Fornals equalised on the stroke of half-time, Leicester went on to secure all three points when Demarai Gray (56), who saw his 12th minute penalty saved by Lukasz Fabianski, finished a swift counter-attack.
Pellegrini leaves West Ham just one point above the relegation places following a run of just two wins from their last 13 Premier League matches.
Meanwhile, victory sees Leicester bounce back from back-to-back defeats to Manchester City and Liverpool to consolidate their position in second place in the table by opening up a four-point gap to third-placed City.
How Leicester deepened West Ham's troubles
Leicester, who were without the Premier League's top goalscorer Jamie Vardy after the birth of his baby girl earlier in the day, had an early opportunity to take the lead early on after the returning Fabianski felled Iheanacho just inside the penalty area.
West Ham: Fabianski (7), Fredericks (6), Balbuena (6), Diop (6), Masuaku (5), Rice (6), Sanchez (7), Fornals (7), Anderson (7), Lanzini (6), Haller (6).
Subs: Antonio (6), Snodgrass (6), Ajeti,
Leicester: Schmeichel (7), Justin (8), Morgan (6), Evans (8), Fuchs (7), Albrighton (8), Choudhury (7), Mendy (7), Gray (7), Perez (7), Iheanacho (8).
Subs: Maddison (6), Ndidi (6), Barnes (n/a).
Man of the match: Kelechi Iheanacho.
In the absence of regular penalty taker Vardy, Gray stepped up, but the Poland international, who was booked for the challenge on Iheanacho, guessed the right way to block the England U21 international's spot kick.
Leicester - who made nine changes - continued to look threatening and Iheanacho, who came into the starting line-up in place of the absent Vardy, was involved again when Leicester eventually took the lead five minutes before the interval.
Ayoze Perez kept Justin James' hopeful cross in play and Iheanacho was on hand to head home from close range.
However, the lead did not last long as Fornals ran on to Felipe Anderson's cut back before side-footing the ball beyond the dive of Kasper Schmeichel and into the bottom corner for his first Premier League goal.
Jamie Vardy was missing from the Leicester squad for the 5.30pm kick-off at West Ham. The 17-goal striker was rested with Kelechi Iheanacho starting up front, one of nine changes made by manager Brendan Rodgers.
Lukasz Fabianski made a welcome return in goal for West Ham after three months out with a hip injury.
Despite the equaliser, the home fans were getting increasingly restless at the London Stadium, and Pellegrini's decision to substitute record signing Sebastien Haller, rather than give him some support in attack, was met with loud jeers.
The mood got even worse when Leicester went ahead again 11 minutes into the second half.
Perez's through-ball sliced open the West Ham defence and Gray, who got redemption for his penalty miss, took a touch before curling the ball inside the near post to secure a first league win in four games for Rodgers' side.
This time West Ham, who have won just twice in 14 matches in all competitions, had no answer, and if they put in a display as abject as this at home to Bournemouth on New Year's Day Pellegrini's position could be under serious threat.
West Ham pay tribute to Peters
Ahead of kick-off, West Ham remembered West Ham and England legend Martin Peters, who died at the age 76 last week.
Peters, who was a key figure in England’s 1966 World Cup victory, was remembered with a minute’s applause, while former West Ham and England team-mate Sir Geoff Hurst laid a floral tribute replicating Peters' shirt in the centre circle alongside Peters' daughter Leeann.
The pundit view on Pellegrini's West Ham
Speaking before Pellegrini's exit, Tony Cottee told Sky Sports News he felt decisions needed to be made.
"I think decisions need to be made at the football club if I'm honest.
"I don't want to take anything away from Leicester - they made nine changes today and took a gamble. It was a very professional performance.
"But looking at the faces of the West Ham fans - they are so fed up with what's going on. I think someone needs to take the lead and make some decisions. They're on a really poor run of form. Defensively they're all over the place. Up front, they hardly created anything. Haller was playing on his own. You can't play one up front at home; have a go. When they went behind they didn't look like getting back in it.
"Some of the decisions the manager makes baffle me. I don't know where West Ham go from here. Bournemouth, who are on a poor run, are up next. That's massive but on this evidence, I don't see West Ham lifting their game. Alarm bells are ringing. West Ham are in massive relegation trouble. The board need to have a good look at this situation and work out whether this manager is the man to lift everyone and start getting results."
What the managers said...
Speaking before his departure, Manuel Pellegrini said : "After we made it 1-1, we played those last ten minutes of the first half the way that we wanted to play but maybe in the second half we didn't create the chances and lost too many balls against a team that keeps the ball, with good players.
"They scored their second goal and we were not able to create any more chances.
When asked if he thinks he will be given time to turn things around, he added: "I cannot answer that question. It does not depend on me. I must continue working. We need to find a way to recover our trust and win our next game.
"I hope that this team will recover the performances we had at the beginning of the season. We need to win our home games. Away from home we are not doing bad and have points but our home games, just one point from 18 makes it more difficult. Sure, with one game we can win here, maybe Bournemouth, it will make it better."
Leicester boss Brendan Rodgers: "This is a league where you have to be at your maximum, especially how I askthe players to play. To play how we wanted to play today we needed that energy and attitude. I felt the changes were important for us.
"At the beginning of the season we were tipped as a possibility, with one or two other clubs, to break into the top six. For us to be sat sandwiched between two incredible teams - two historic teams - really shows the quality and the consistency of this group."
Man of the match - Kelechi Iheanacho
In the absence of 17-goal Vardy, Leicester needed someone to step up - and Ihenacho did just that.
He led the line superbly, winning Leicester an early penalty before being in the right place at the right time to head home his side's first goal.
Iheanacho has been directly involved in five goals in his last four Premier League games (3 goals, 2 assists), more than he had been in his previous 30 for the Foxes (4).
The form he's in right now, he's certainly someone Rodgers can rely on.
Opta stats - West Ham's home struggles continue
- West Ham have won fewer points at home than any other Premier League side this season (7). Indeed, the Hammers have already lost as many home games this term as they did in both 2017-18 and 2018-19 (6 each).
- The Hammers have now lost four consecutive Premier League home games for the first time since January 2006.
- Only Liverpool (8) have won more Premier League away games than Leicester this season (6).
- Leicester made nine changes to their starting XI from their last Premier League match, the most changes they've ever made between games in the competition.
West Ham face a crucial encounter against Bournemouth at the London Stadium on New Year's Day; Kick-off at 5.30pm.
Up next for Leicester is a trip to St James' Park to face Newcastle; Kick-off at 3pm, also on New Year's Day.