Manchester City needed a second-half Sergio Aguero penalty to see off West Ham and stay one point behind leaders Liverpool at the top of the Premier League.
The defending champions had to wait for the Argentina striker's 59th-minute spot-kick to break down the well-organised Hammers, but ultimately it was enough to secure a vital victory.
City, who are still chasing glory on three fronts after winning the Carabao Cup on Sunday, showed off that trophy before kick-off and tore into the visitors in the opening minutes.
But the closest they came to an early goal was when David Silva turned Kevin de Bruyne's cross on to a post and West Ham soon began to frustrate them.
The Hammers did not threaten at all at the other end until Andy Carroll brought a fine save from Ederson with their first shot of the game at the start of the second half.
However they succeeded in keeping City quiet and, with Liverpool comfortably ahead against Watford, the home fans' frustration began to show.
City were utterly dominant on the ball with more than 80% of possession but they needed the introduction of Raheem Sterling and Bernardo Silva off the bench to provide the spark they needed in attack.
Silva took a matter of minutes to make an impact, cutting into the box from the right and going down under pressure from Felipe Anderson, to prompt referee Stuart Atwell to point to the spot.
Aguero made no mistake, sending Lukasz Fabianski the wrong way for his 25th goal of the season
More City chances followed, with Ryan Fredericks clearing off the line from Silva and Sterling missing the target from close range, but in the end one goal was sufficient.
More Sports Headlines
- Guardiola: They have to fix VAR
- African Games: Black Satellites win opener against Burundi
- VAR denies Man City again against Spurs
- Kroos piledriver helps Real Madrid win at Celta but Modric sees red
- Mane and Firmino give Liverpol win at Southampton
- Dortmund crush Augsburg to set title marker in season opener
- Lacazette and Aubameyang give Arsenal the edge over sturdy Burnley
- Former Nigeria great Samson Siasia handed life ban by Fifa
- Aduriz, 38, scores stunning goal as Athletic Bilbao beat Barcelona
- Coutinho set for Bayern Munich loan move
- Ghana's Patrick Twumasi joins Turkish club on loan
- Skyy FC owner unhappy with Normalisation Committee's draft statutes
- Andre Ayew focused on Swansea amid transfer rumours
- Liverpool goalie could miss Southampton game after pitch invader injured his ankle
- Hazard out of Madrid season opener with thigh injury