David Silva volleyed a late winner as Premier League leaders Manchester City came from behind beat stubborn West Ham 2-1 at the Etihad Stadium.
The Spaniard, who extended his contract this week, volleyed home from close range seven minutes from time after being picked out by a brilliant Kevin De Bruyne cross.
City had trailed at half-time to an Angelo Obgonna header, but dominated the second period and pulled level through Nicolas Otamendi.
City's victory was their 13th in succession in the Premier League, a club record 20th straight in all competitions and restored an eight-point lead at the top of the table.
West Ham remain without a win under David Moyes but, after forcing City to rely on late heroics for a third successive game, they will take much encouragement.
Having seen Huddersfield and Southampton stifle City in the past week and go close to getting a result, Moyes decided to replicate their formula. That meant defending deeply, absorbing pressure and delaying restarts from dead-ball situations.
It proved successful in the first half as City dominated possession but struggled to create clear-cut chances. West Ham actually had the better openings, even though they saw little of the ball.
Their first chance came as Michail Antonio, playing as a lone striker, volleyed over from close range after Cheikou Kouyate flicked on a corner.
Silva had the hosts' best opportunity of the first half when his deflected long-range strike was tipped over by Adrian, who was deputising for the ineligible on-loan City keeper Joe Hart.
Apart from that it proved a frustrating period for City, who were almost caught out when Manuel Lanzini broke into the area, but Ederson saved.
West Ham suffered a blow when Kouyate was forced off injured, but they were rewarded for their hard work on the stroke of half-time. Not for the first time lately, a set-piece proved City's undoing as Ogbonna rose following a short corner to power in a header from an Aaron Cresswell cross.
That stung City into action, with manager Pep Guardiola bolstering his attack by sending on Gabriel Jesus for the second half in place of defender Danilo.
The change of shape worked with Leroy Sane and Raheem Sterling getting more ball out wide and Jesus joining Sergio Aguero in the middle.
The equaliser came just before the hour after the increasingly impressive Adrian pushed away a De Bruyne free-kick. City kept the ball moving and Jesus crossed for Otamendi to scramble home his fourth goal of the season.
City then stepped up the tempo and Adrian did well to save twice from Sane and also keep out further efforts from De Bruyne and Sterling.
The pressure became almost relentless, although West Ham did threaten on a rare break as Antonio tested Ederson from distance.
Pressure eventually paid off as De Bruyne picked out Silva with a brilliantly executed lofted cross into the box and the Spaniard met it with a firm volley.
That proved enough, although West Ham might have snatched a last-gasp point when Diafra Sakho flashed a shot wide.