The scoreline suggests it was a comfortable win for the Gunners, but it was anything but, especially after Marko Arnautovics fierce strike cancelled out Nacho Monreals opener.
However, the course of the game changed when Aaron Ramseys 82nd-minute cross-cum-shot from the left found its way into the net after Declan Rice inexplicably ducked away from the ball.
Alexandre Lacazette added two late goals to ensure Arsenal finished the game with a flourish and they now head into their huge Europa League first leg against Atletico Madrid on Thursday in good spirits, while David Moyes' side are not completely safe from the drop zone.
Arsenal have been a very frustrating side to watch this season and it was looking like another one of those days when Arnautovic pegged them back midway through the second-half.
However, Aaron Ramsey had something to say on the matter and it was his goal which allowed his side to end up earning a flattering scoreline. The Welshman also gave Lacazette the assist for his second goal.
MOMENT OF THE MATCH
In tight games like these it's often a moment of magic or a big mistake which helps a team win and it was the latter in this game.
Ramsey's rather hopeful cross bounced beyond Joe Hart in the Hammers goal after Rice ducked away from the ball to give Arsenal the lead again and it was one way traffic from that point.
WHAT THE FANS ARE SAYING
Arsenal XI: Ospina, Bellerin, Koscielny, Mustafi, Monreal, Elneny (Maitland-Niles 44), Xhaka, Ramsey, Iwobi (Aubameyang 70), Welbeck (Chambers 87), Lacazette
Subs not used: Macey, Mertesacker, Holding, Nelson
West Ham XI: Hart, Zabaleta, Ogbonna, Rice, Cresswell, Masuaku (Carroll 86), Kouyate, Noble, Fernandes (Lanzini 59), Joao Mario (Chicharito 59), Arnautovic
Subs not used: Adrian, Cullen, Evra, Hugill
ARSENAL v Atletico Madrid (Europa League) – Thursday April 26