Riyad Mahrez put the Foxes in the lead after just five minutes, and Robert Huth added the second two minutes later.
Manuel Lanzini halved the deficit for the Hammers in the 20th minute, but Jamie Vardy restored Leicester’s two-goal cushion on 38 minutes.
Andre Ayew scored for the Hammers on 63 minutes, but the visiting team held on for all three points.
Former West Ham winger Trevor Sinclair, who now works as a pundit for BBC Sport, was following the match, and during the game he suggested on social networking site Twitter that Mark Noble’s absence was being felt.
Ahead of the match, West Ham manager Slaven Bilic told talkSPORT that the 29-year-old midfielder has been given an extended game.
Wonder if Nobes's experience and reading of the game is gunna be missed today— Trevor Sinclair (@trevor8sinclair) March 18, 2017
Sensational freekick from Lanzini makes it 2-1. Credit where it's due.— Gary Lineker (@GaryLineker) 18 March 2017