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.