A Ben White own goal and strikes from Mohammed Kudus and Jarrod Bowen ensured the Hammers ended a difficult week with a statement victory.
Here's how David Moyes's side rated at the London Stadium...
Lukasz FabiaÅski 6
Tipped over smartly from Havertz early on. Bold at corners after break after West Ham had looked vulnerable before the break.
Vladimir Coufal 7
Charge and cross down the right created Bowen third.
Konstantinos Mavropanos 6
Not the headline in terms of players facing their former clubs but
Nayef Aguerd 7
Good block on Nelson and did enough to put Nketiah off awkward chance. Booming ball in behind to set up Kudus goal.
Tested by the lively Nelson but another solid outing on his return from suspension.
Edson Alvarez 7
Raking pass earned the corner from which Hammers forced opener. More like it after a couple of poor displays.
Tomas Soucek 7
Perhaps fortunate to get away with tug on Ramsdale for opener but with no VAR it looked canny. Unshowy but brings stability to this midfield.
Mohammed Kudus 8
One terrible pass across his own box that will have given Moyes kittens but Nelson's shot was blocked. All quality for his goal, though, with perfect touch and strike.
Lucas Paqueta 8
Terrific run and pass just after half-time made Bowen opening. Looks happier at No10. Dug into his box of tricks late on.
Said Benrahma 7
One brilliant full-length tracking of Nelson followed minutes later by rolling out the red carpet for the same player. Never change.
Jarrod Bowen 8
Harried and pressed from his central role. Brilliant corner forced White's own-goal. Denied by brilliant Ramsdale save moments after the break but got his goal with deflected strike.
James Ward-Prowse (Benrahma 81') N/A
Thilo Kehrer (Kudus 88') N/A
Unused: Areola, Cresswell, Ogbonna, Fornals, Cornet, Ings, Antonio