West Ham relieved the pressure on boss Manuel Pellegrini as they ended their seven-game winless run with a first victory at Chelsea for 17 years.
Aaron Cresswell scored the winner three minutes after the break as he cut inside and fired low past Kepa Arrizabalaga.
Chelsea had plenty of chances early on as Christian Pulisic missed the target from a few yards out. The American also wasted a great opportunity late on.
But Pellegrini was rewarded for picking 33-year-old David Martin in goal instead of Roberto as his side held firm under late pressure.
It proved an inspired choice as Martin, whose father Alvin is a West Ham legend, made several good saves to keep a clean sheet on his Hammers and Premier League debut.
The visitors also thought they had gone 2-0 up after 71 minutes, but Michail Antonio’s goal was ruled out for handball.
Victory lifted West Ham six points clear of the relegation zone while Chelsea failed to close the three-point gap to second-placed Manchester City and Leicester City in third.
However, the day belonged to Martin, who sank to his knees and was close to tears at the end of the game before celebrating in the stands with his father, who played in the West Ham defence for 20 years.
Frank Lampard’s decision to rotate his line-up following midweek exertions in Valencia backfired.
The majority of the back four and goalkeeper Kepa Arrizabalaga remained the same, but with Emerson coming in for Cesar Azpilicueta at left-back, alongside Fikayo Tomori, Kurt Zouma and Reece James.
Mason Mount came in for N’Golo Kante to play with Jorginho and Mateo Kovacic in a midfield three with a more attacking look, while further forward Olivier Giroud replaced Tammy Abraham after the latter picked up a hip injury in Spain.
Pedro came in for Willian as one of the two wide players, Christian Pulisic keeping his place on the other wing.