They almost found a way to lose it, but Mayo managed to hang on and book their ticket to next weekend's Round 4 of the All-Ireland SFC Qualifiers in Castlebar on Saturday evening.

A pulsating game of knock-out championship football hung in the balance right until the final whistle, with the crowd of 18,711 captivated by a match that lived up to its billing.

The Westerners looked to have broken Armagh's stubborn resistance when substitute Kevin McLoughlin fired in a goal in the 52nd minute to push the home side into a four points lead.

When the outstanding Darren Coen fired over a terrific score (his fourth of the game) moments later, Mayo seemed well-placed to kick on.

Instead Armagh came roaring back into contention with four points in as many minutes hauling Kieran McGeeney’s side back into contention.

They were delivered by three of Armagh’s best performers on the night, Jamie Clarke, team captain Rory Grugan and the sensational Stefan Campbell.

Clarke was also denied a goal by an excellent save from Mayo goalkeeper, David Clarke, who pushed his namesake’s goalbound shot on to the post. 

By the time this purple patch ended, Mayo’s lead had been whittled back to the bare minimum and Armagh’s large band of travelling support could sense an upset on the cards.

It was at that stage that Cillian O’Connor, who had come off the bench in the 50th minute to make his first competitive appearance for Mayo in exactly 12 months, stepped up to the plate.

His county’s all-time leading scorer held his nerve to convert two frees in the 67th and 71st minutes to give James Horan’s charges a little breathing space.

It didn’t last long though as Armagh laid siege to the Mayo goals in the dying minutes and late scores from Rian O’Neill (free) and the relentless Stefan Campbell in the 73rd and 74th minutes meant nobody could rest easy. 

There was still time for a few more nervous moments in front of the Mayo goal, but Armagh’s last chance of an equaliser was spurned by Niall Grimley who saw his long-range effort drift wide. 

The roar that greeted the final whistle from the huge crowd of Mayo supporters told its own story. 

A rip-roaring game had started in a welter of excitement too with Rian O’Neill’s goal in the sixth minute (which was followed by his now-trademark 'You can’t see me’ celebration) propelling Armagh into the lead.

But inside sixty seconds, Mayo had the ball in the net at the other end when Fionn McDonagh fired past Blaine Hughes after Andy Moran had picked him out a precise pass.

From there to the break it was nip and tuck, with the sides level on five occasions before a couple of back-to-back Mayo points from Jason Doherty and Paddy Durcan edged them into a 1-6 to 1-5 lead at half-time.

By that stage, James Horan had seen his lengthy injury list grow even longer as Lee Keegan was assisted off the field with a foot injury. 

There was nothing to choose between the teams throughout that entertaining first half, and it was a similar story all through the second.

Mayo improved considering on their scoring ratio after the restart, scoring 1-7 from eight shots to pip Armagh at the post as the Orchard County paid a heavy price for racking up a dozen wides. 

Their season is now over, while Mayo must regroup before their third game in three weeks against one of the beaten provincial finalists next weekend.

Mayo: D Clarke; C Barrett, B Harrison, K Higgins; L Keegan, C Boyle, P Durcan (0-1); M Murray, A O'Shea; F McDonagh (1-1), C Loftus (0-2, 2fs), J Doherty (0-1); D Coen (0-4), A Moran, C Treacy.

Subs used: K McLoughlin (1-1) for A Moran; S Coen for Keegan (inj); D Vaughan (0-1) for Murray; C O’Connor (0-2, 2fs) for Loftus; F Boland for Doherty (inj); E Regan for Treacy.

Armagh: B Hughes; P Burns, A McKay, P Hughes; A Forker, B Donaghy, M Shields; J Óg Burns, N Grimley (0-1); J Hall, A Nugent, S Campbell (0-4); J Clarke (0-5, 2fs), R O’Neill (1-2, 2fs), R Grugan (0-3).

Subs used: E Rafferty for Nugent; G McCabe for McKay; B Crealey for Burns.