Arsenal came from behind to end their nine-match winless streak as Freddie Ljungberg enjoyed his first victory as interim manager at the expense of his former club West Ham.
Eighteen-year-old Gabriel Martinelli marked his full Premier League debut by side-footing an equaliser which cancelled out Angelo Ogbonna’s deflected first-half opener at London Stadium.
Within nine minutes, Nicolas Pepe had curled a magnificent second into the top corner and Pierre-Emerick Aubameyang fired in a third.
The salvo turned the game on its head and piled the pressure on West Ham boss Manuel Pellegrini, whose side have taken four points from their past nine league games and conceded three times in three successive home games.
The Hammers remain a point above the relegation zone in 16th and face a trip to third-bottom Southampton on Saturday. Arsenal move up two places to ninth.
Arsenal recover from dismal start
Arsenal’s victory was all the more remarkable because until Martinelli added to the seven goals he has scored in cup competitions this season, the visitors had been utterly woeful.
Club officials had spoken before kick-off about the improved atmosphere triggered by Ljungberg’s appointment as Unai Emery’s replacement but it appeared this game would end in frustration, just as the previous two had done under the Swede.
The visitors were bereft of confidence and mild boos from the travelling support accompanied the end of a first half in which their side failed to have a shot on target and went behind when Ogbonna’s header bounced in off Ainsley Maitland-Niles.