Eddie Nketiah's late goal ensured Arsenal maintained their 100% Premier League start as they condemned West Ham to a second successive defeat.
The Gunners largely controlled the early stages and went ahead with their first effort on goal when Alexandre Lacazette headed in from Pierre-Emerick Aubameyang's chipped cross.
Despite Mikel Arteta's team largely dominating possession West Ham slowly grew into the game.
The Hammers, who always looked dangerous on the counter-attack, levelled just before the interval when Michail Antonio bundled in Ryan Fredericks' cross at the end of a sweeping move.
While Arsenal continued to enjoy more of the ball after the break, David Moyes' side created the better openings in front of goal with Antonio heading against the bar and seeing a scuffed close-range effort saved by Bernd Leno.
However, Nketiah's late tap-in from a Dani Ceballos pass ensured Arsenal continued their fine home record against the Hammers, having won 11 of the last 12 meetings at Emirates Stadium.
Arsenal eke out another win
While there have been considerable signs of improvement at Arsenal since Arteta took charge last December this performance appeared to fizzle out after Lacazette had registered his 50th goal in all competitions for the club.
The crispness of passing, swift attacking and solidity at the back were all noticeably missing and it allowed West Ham a route back into the encounter.
However, the pleasing aspect for the Spaniard will be that his team were still capable of eking out a victory from an under-par showing.
Nervy at the back throughout, Arteta's side survived several close scares and struggled to break free of their lethargy despite the introduction of £72m winger Nicolas Pepe.
It took another substitute, Nketiah, to make the difference, with his tap-in coming eight minutes after he had come on to replace Lacazette.
More to follow.
Live reaction from Arsenal v West HamPlayer of the match
NketiahEddie Nketiah
with an average of 7.20
Arsenal
Squad number30Player nameNketiah
Squad number9Player nameLacazette
Squad number8Player nameDani Ceballos
Squad number14Player nameAubameyang
Squad number7Player nameSaka
Squad number6Player nameGabriel Magalhães
Squad number34Player nameXhaka
Squad number12Player nameWillian
Squad number1Player nameLeno
Squad number19Player namePépé
Squad number2Player nameBellerín
Squad number16Player nameHolding
Squad number23Player nameDavid Luiz
Squad number31Player nameKolasinac
West Ham United
Squad number30Player nameAntonio
Squad number28Player nameSoucek
Squad number41Player nameRice
Squad number20Player nameBowen
Squad number26Player nameMasuaku
Squad number21Player nameOgbonna
Squad number24Player nameFredericks
Squad number1Player nameFabianski
Squad number23Player nameDiop
Squad number18Player nameFornals
Squad number7Player nameYarmolenko
Squad number3Player nameCresswell
Squad number22Player nameHaller
Squad number8Player nameFelipe Anderson
Line-ups
Arsenal
1Leno16Holding6dos Santos Magalhães31Kolasinac2Bellerín8Ceballos34Xhaka7SakaSubstituted forDavid Luizat 89'minutes12WillianSubstituted forPépéat 64'minutes9LacazetteSubstituted forNketiahat 77'minutes14AubameyangSubstitutes
15Maitland-Niles19Pépé23David Luiz25Elneny28Willock30Nketiah33MaceyWest Ham
1Fabianski24FredericksBooked at 40mins23Diop21Ogbonna3Cresswell26MasuakuSubstituted forFelipe Andersonat 90'minutes20BowenSubstituted forYarmolenkoat 83'minutes28Soucek41Rice18FornalsSubstituted forHallerat 88'minutes30AntonioSubstitutes
4Balbuena7Yarmolenko8Felipe Anderson10Lanzini22Haller31Johnson35RandolphLive Text
Match ends, Arsenal 2, West Ham United 1.
90'+5'
Second Half ends, Arsenal 2, West Ham United 1.
90'+4'
Corner, Arsenal. Conceded by Angelo Ogbonna.
90'+4'
Attempt blocked. Nicolas Pépé (Arsenal) left footed shot from outside the box is blocked. Assisted by Pierre-Emerick Aubameyang.
90'+2'
Dani Ceballos (Arsenal) wins a free kick in the defensive half.
90'+2'
Foul by Sébastien Haller (West Ham United).
90'+1'
Foul by Dani Ceballos (Arsenal).
90'+1'
Declan Rice (West Ham United) wins a free kick in the defensive half.
90'+1'
Attempt saved. Pierre-Emerick Aubameyang (Arsenal) right footed shot from outside the box is saved in the centre of the goal.
90'
David Luiz (Arsenal) wins a free kick in the defensive half.
90'
Foul by Sébastien Haller (West Ham United).
90'
Substitution, West Ham United. Felipe Anderson replaces Arthur Masuaku.
89'
Substitution, Arsenal. David Luiz replaces Bukayo Saka.
88'
Substitution, West Ham United. Sébastien Haller replaces Pablo Fornals.
88'
Attempt missed. Tomas Soucek (West Ham United) header from the left side of the six yard box misses to the left. Assisted by Declan Rice with a cross.
85'
Goal! Arsenal 2, West Ham United 1. Eddie Nketiah (Arsenal) right footed shot from the centre of the box to the centre of the goal. Assisted by Dani Ceballos.
83'
Substitution, West Ham United. Andriy Yarmolenko replaces Jarrod Bowen.
78'
Corner, Arsenal. Conceded by Arthur Masuaku.
77'
Corner, Arsenal. Conceded by Ryan Fredericks.
77'
Substitution, Arsenal. Eddie Nketiah replaces Alexandre Lacazette.