The Gunners recorded an eighth home league success to keep the pressure on second-placed Manchester City after finally seeing off what was a spirited second-half effort from the Hammers.
Theo Walcott, recalled to the starting XI following injury to Alex Oxlade-Chamberlain, had missed a couple of early chances before goalkeeper Adrian was beaten on the stroke of half-time by a fierce angled drive from French striker Giroud, which cannoned in off the far post.
West Ham, who have plummeted down the table following a poor run of results, regrouped for the second half and would have been good value for an equaliser.
However, Arsenal finally broke then down again with nine minutes left when Aaron Ramsey fired in after a neat one-two with Giroud and substitute Mathieu Flamini rolled home a third to send Arsene Wenger’s side into next week’s Champions League tie away to Monaco with renewed hope of an unlikely comeback.
Walcott, who had not played since the 3-1 European home defeat by the French side on February 25, was played clear by a flick from Giroud on five minutes.
However, he hesitated in the six-yard box and James Collins made a last-ditch block as referee Chris Foy waved away appeals for a penalty with Walcott sprawling on the floor.
Arsenal remained on the offensive, and in the 15th minute West Ham goalkeeper Adrian had to be alert to turn away a bullet header from Alexis Sanchez.
West Ham, who had just one win from the last nine league games, tried to offer something on the counter. Midway through the half Matt Jarvis got clear down the right and pulled the ball back to Kevin Nolan at the edge of the penalty area. The West Ham captain drilled a volley goalwards, which David Ospina scrambled away.
Arsenal almost snatched the lead when Ramsey’s flick up off his knee from Calum Chambers’ cross was palmed over by Adrian.
The Spaniard was needed again in the 33rd minute after Walcott latched onto a through ball from Ramsey, but saw his effort blocked at the near post.
Sanchez had an effort palmed away and was then booked for handball as he flapped at a high ball into the six-yard box.
Walcott spurned another great chance on the stroke of half-time when Mesut Ozil’s snapshot was deflected out by Adrian, but the England forward could only fire the ball high into the Clock End.
It was finally 1-0 in added time, with a goal of the highest quality by Giroud.
Another quick exchange of passes around the penalty area saw Ramsey burst clear into the right. Giroud ran across to neatly collect the ball from him before rifling a left-foot strike in off the far post.
There was a stoppage at the start of the second half when Ospina needed treatment after being clattered into by Diafra Sakho at the near post, but was soon able to resume.
West Ham were much improved and continued to press a higher line, with Jarvis blazing the ball over from a corner.
On the hour referee Foy could not continue due to injury and was replaced by fourth official Anthony Taylor.
Arsenal made a change in the 65th minute when Sanchez was replaced by Danny Welbeck, who scored the winning goal against former club Manchester United in the FA Cup quarter-final on Monday night.
Ozil then chose to chip back across goal rather than shoot when clear on the left, with Walcott’s knockdown volleyed wide by Ramsey.
Arsenal finally ended West Ham’s resilience with a second goal in the 81st minute. Giroud and Ramsey exchanged a neat one-two on the right side of the penalty area before the Wales midfielder drilled the ball past Adrian.
Flamini had not been on the pitch long before he arrived on cue at the far post for a tap-in after Santi Cazorla’s one-two with Giroud down the left.