Arsenal survived an almighty scare from Preston North End and overturned a torrid first half to win 2-1. The Championship side outplayed the Gunners in the opening period and missed several gilt-edged chances. Their profligacy was punished as Ramsey and Giroud bagged the goals for Arsene Wenger’s men and ensured safe passage to the fourth round of the FA Cup.

Wenger made minimal changes to the team that drew 3-3 against Bournemouth and chose to send out a strong side. David Ospina reprised his role as cup keeper behind a backline of Gabriel, Mustafi, Monreal, and Maitland-Niles. Ramsey and Xhaka formed the midfield fulcrum in the face of injuries and international duty for their colleagues. Iwobi played in the attacking midfield role behind a three-pronged attack of Lucas, Oxlade-Chamberlain, and Giroud.

A few days after Bournemouth’s energy and verve caught Arsenal off-guard, those shortcomings were eerily repeated. Preston played a 4-4-2, making up for their one man less in midfield with increased work rate and desire to win second balls. Arsenal’s backline seemed unnerved to face two strikers, making elementary mistakes with marking, passing out from the back, and their offside trap.

Preston’s high energy start paid dividends immediately, as they took the lead in the sixth minute. McGeady waltzed past both Ramsey and Xhaka with far too much ease before playing a smart ball behind Monreal. The Spanish full-back was caught napping and his tentative tackle deflected the ball into the path of Callum Robinson to tap in.

Preston's English striker Callum Robinson celebrates after scoring the opening goal as Arsenal's Colombian goalkeeper David Ospina (L) reacts during the English FA Cup third round football match between Preston North End and Arsenal at Deepdale in north west England on January 7, 2017. / AFP / Lindsey PARNABY / RESTRICTED TO EDITORIAL USE. No use with unauthorized audio, video, data, fixture lists, club/league logos or 'live' services. Online in-match use limited to 75 images, no video emulation. No use in betting, games or single club/league/player publications.  /         (Photo credit should read LINDSEY PARNABY/AFP/Getty Images)

Preston’s English striker Callum Robinson celebrates after scoring the opening goal as Arsenal’s Colombian goalkeeper David Ospina (L) reacts during the English FA Cup third round football match between Preston North End and Arsenal at Deepdale in north west England on January 7, 2017. LINDSEY PARNABY/AFP/Getty Images

Arsenal temporarily woke up after the opener, Giroud’s lay-off setting up a snapshot for Perez that was easily saved. That chance aside, the away side were slow and ponderous in their build-up play, often eschewing attacking options for cautious passing and futile recycling of possession. At the other end, Preston looked dangerous every time they had the ball. In the 21st minute, the ball was played out to Hugill with the Arsenal defence at sea. Hugill’s chipped ball in was perfect for Robinson but he placed the header straight towards Mustafi who was able to execute the block.

Two minutes later, an even better chance came along. Robinson beat the offside trap as Gabriel mistimed his rush-out, and the simple ball across goal was just out of the flailing Hugill’s reach. Still Preston pressed. Pearson let loose a shot from range that bounced just in front of Ospina, the Colombian doing well to parry it out of the way. Arsenal were rattled and couldn’t find a way out of their box.

As the half drew to a close, the game became more end-to-end as Arsenal mustered a few chances. First a Maitland-Niles cross was headed wide by Giroud, and then some good work by Iwobi set Giroud free but his cross-shot flew disappointingly past the target. At the other end, Preston wasted another inviting opportunity. Mustafi’s poor touch sent Gallagher through on goal, and his chipped shot past Ospina was cleared off the line by Monreal.

When the half-time whistle blew, the only thing surprising about the scoreline was that it was only 1-0 to Preston.

Being a fly on the wall of Arsenal’s dressing room at half-time would have been riveting, because the Gunners emerged in the second half smarting, energized, and ready to put things right. Fifty seconds in, Iwobi jinked his way into the box and squared the ball to Ramsey who lashed it past the Preston keeper to equalize. The timing of the equalizer was critical, ruffling Preston’s feathers and lending shine to Arsenal’s.

PRESTON, ENGLAND - JANUARY 07:  Aaron Ramsey of Arsenal scores a goal to level the scores at 1-1 during the Emirates FA Cup Third Round match between Preston North End and Arsenal at Deepdale on January 7, 2017 in Preston, England.  (Photo by Michael Regan/Getty Images)

PRESTON, ENGLAND – JANUARY 07: Aaron Ramsey of Arsenal scores a goal to level the scores at 1-1 during the Emirates FA Cup Third Round match between Preston North End and Arsenal at Deepdale on January 7, 2017 in Preston, England. (Photo by Michael Regan/Getty Images)

Arsenal were much better in the second half (they couldn’t have been much worse), hungrier in the duels, forcing Preston into mistakes, and passing the ball quicker. In the 65th minute, Huntington almost turned a looping set-piece delivery from Xhaka into his own net. Five minutes later, a low corner by Oxlade-Chamberlain was powerfully met by Mustafi, and Maxwell had to be strong to palm the ball away.

In the 76th minute, Arsenal thought they had taken the lead. Perez executed a clever lob pass into the path of Giroud to sweep into the net, only to be denied by the offside flag.

As the match wound down and both sides prepared themselves for a replay, Ramsey floated a ball into Giroud that would change everything. The Frenchman met the cross and flicked it on to Perez, whose clever backheel found its way back to Giroud to prod it past the keeper via a deflection. Arsenal had gotten out of jail again, and Giroud was their savior again.

There was still time before the final whistle for returning striker Danny Welbeck to send a rasping shot towards goal that Maxwell did well to parry. Giroud’s goal had visibly shaken Preston and the home side had nothing left in the tank after running themselves to the ground in the first half.

Arsenal enter the fourth round of the FA Cup for the 21st successive time under Arsene Wenger, but there have been fewer victories more narrow or begotten by luck. The North Londoners need to start games better and move the ball quicker against Swansea next week because Preston’s wastefulness is unlikely to be replicated.