France striker Giroud – who has now scored five times in his last five matches against West Ham – struck just before half-time and then combined with Ramsey on 81 minutes for Arsenal’s second before linking up with Santi Cazorla, who teed-up fellow sub Flamini for a third six minutes from time.
Arsenal’s win was their ninth in a row over their London rivals and, coupled with Man City’s shock defeat to Burnley on Saturday Night Football, opens the door for a second-place finish.
West Ham were out-played for much of the opening half – in which Theo Walcott missed three clear-cut opportunities – and although Sam Allardyce’s side improved after the restart they are now without a win in their last eight in all competitions.
Arsenal had begun the week by beating Manchester United to reach the semi-finals of the FA Cup and started brightly against West Ham as they aimed to strengthen their position in the Champions League qualifying spots.
The hosts should have been ahead with just five minutes on the clock when a clever flick from Giroud released Walcott in the box but he delayed his shot too long and referee Chris Foy then waved away penalty appeals when James Collins tumbled the forward without touching the ball.
Alexis Sanchez then drew a fine save from Adrian – but Kevin Nolan demonstrated West Ham’s threat on the break when he connected with a Matt Jarvis cross and tested David Ospina with a powerful volley.
At the other end, Giroud found the side-netting from a tight angle and Ramsey – making his first start in over a month – forced Adrian to tip the ball over the bar from Calum Chambers’ centre as Arsenal resumed control.
Walcott then wasted a golden opportunity to break the deadlock, shooting tamely at the West Ham ‘keeper when clean through on goal before Mesut Ozil made the same mistake from close range and Walcott slipped as he tried to convert the rebound into an unguarded net.
However, Arsenal weren’t to be denied a first-half advantage, as Giroud rifled a powerful left-foot shot into the top corner from 15 yards after neat build-up play between Ozil and Ramsey in the 45th minute.
West Ham had lost their previous eight matches against Arsenal but made a positive start to the second half and Jarvis wasted a good chance to equalise when he fired over the bar from a Stewart Downing corner when well placed.
Arsenal struggled to dominate the game as they had in the first half but could have doubled their advantage when Ozil found space in the box, however, the Germany international opted to cross rather than shoot and Ramsey’s subsequent volley flew wide.
The Wales midfielder was on target on 81 minutes, though. After playing a smart one-two with Giroud, Ramsey finished in style from just inside the West Ham box.
Just three minutes later Arsenal had the ball in the net again as sub Cazorla exchanged passes with Giroud before picking out Flamini at the back post, who tapped in with one of his first touches of the game.
Sub Danny Welbeck – fresh from warming up alongside fourth official Anthony Taylor, who replaced injured ref Foy – then saw a late header saved, but by then Arsenal had comfortably secured all three points.
Soccer Saturday – Matt Le Tissier’s verdict: “Arsenal were very comfortable in the end, though they were not ruthless enough in front of goal in the first half.
“Second-half, West Ham came out right after half-time and gave it a real go, without really testing Ospina much. In the end, they committed a few more men forward and got caught on the break.
“But the quality of Arsenal’s goals today was outstanding.There was some fantastic little one-touch play around the box.”
Arsenal: Ospina (7), Chambers (7), Koscielny (7), Mertesacker (7), Monreal (7), Coquelin (7), Ozil (7), Ramsey (8), Sanchez (6), Walcott (6), Giroud (8).
Subs: Cazorla (7), Flamini (7), Welbeck (6)
West Ham: Adrian (8), Collins (6), Cresswell (6), Kouyate (6), O’Brien (7), Downing (6), Jarvis (6), Noble (6), Nolan (6), Song (7), Sakho (7).
Subs: Amalfitano (6), Nene (6)
Man of the match: Olivier Giroud