A largely uneventful and lacklustre game ended in a welter of excitement as rank outsiders Louth almost ambushed Mayo at a sun-splashed Hastings Insurance MacHale Park in Castlebar.
The Westerners had been expected to cruise to victory on home ground against the beaten Leinster finalists, who had also lost their opening group game to Cork seven days earlier.
But instead Mayo ended up scrambling over the line as a 75th minute goal from Conall McKeever and a point from Conor Grimes saw Louth just pipped at the post.
Had the game continued for a little longer, Mickey Harte's men could well have snatched a draw so Mayo were relieved to hear the final whistle blow shortly after Grimes’ effort had sailed over.
In front of a crowd of 11,347 supporters, and in stifling heat, Kevin McStay's side didn’t hit the same heights as they had against Kerry a fortnight earlier.
Louth’s defensive system frustrated the homeside for long spells and they stayed within striking distance all through a cagey encounter.
Mayo had led at the end of a slow-burning first half by 0-07 to 0-04, and a fine save by Colm Reape to push Leonard Grey’s goalbound effort over the bar meant the locals were still three points in front after 55 minutes, 0-11 to 0-08.
The teams had swopped scores four times during the third quarter with the best of them coming from Mayo’s Matthew Ruane and Aidan O’Shea (a well-struck free) and Louth’s Ciaran Downey and Niall Sharkey. In an effort to break the stalemate, Kevin McStay sent on substitutes Paddy Durcan, Enda Hession, Tommy Conroy and Fionn McDonagh to bring pace and energy to Mayo’s play.
The changes had the desired effort too as a string of scores followed from Durcan, Aidan O’Shea (free) and McDonagh to edge Mayo five points clear after 74 minutes.
The outcome looked decided at that stage as Louth’s challenge seemed to be fading. However, Mickey Harte’s men came roaring back deep into added time with Donal McKenny and Ryan Burns combining to set up Conall McKeever for a well-taken goal.

The pressure was now back on Mayo and it increased when Conor Grimes fired over a brilliant point seconds later to leave the minimum between the teams in their first championship clash since the 1950 All-Ireland Final.
But there wasn’t enough time for the underdogs to grab an equaliser and Mayo hung on for their second successive group win while Louth crashed to their second defeat in this ultra-competitive group.
The homeside had come flying out of the blocks to race into a three points lead after four minutes as Colm Reape (long-range free), Jack Carney and Ryan O’Donoghue all hit the target.
Louth opened their account on 11 minutes through a Sam Mulroy free, but they were fortunate not to concede a goal shortly afterwards when James Califf pulled off a fine save to deny Mayo full-back David McBrien.
But Mickey Harte’s side stuck to their game-plan, which was designed to frustrate their opponents and play on the counter-attack, and they started to come into contention.
The sides traded scores three times over the next ten minutes to maintain the status quo with the pick of the points coming from Louth’s Conor Grimes and Ciaran Downey (a mark) and Mayo’s Jordan Flynn.
The first half scoring came to a close in the 31st minute when Mayo defender Stephen Coen landed an excellent score from a mark from the left wing to give the locals a three point cushion at the interval.
The second half followed a similar pattern, with Mayo threatening to pull away on a number of occasions but never managing to open up any significant daylight.
And they almost paid a heavy price after Louth’s late rally, but did just enough to secure the victory that sees them stay in pole position to qualify for the All-Ireland quarter-finals as group winners.
Mayo face Cork in round three with Louth taking on Kerry, both at neutral venues.
Mayo: C Reape (0-1, 1f); P O’Hora, D McBrien, D McHugh; J Coyne, S Callinan, S Coen (0-1); M Ruane (0-1), J Flynn (0-1); C Loftus, J Carney (0-1), J Doherty; A O’Shea (0-4, 4fs), J Carr, R O’Donoghue (0-3, 2fs).
Subs used: P Durcan (0-1) for Doherty (50); T Conroy for Carr (50); E Hession for Callinan (60); F McDonagh (0-1) for Flynn (63);
Louth: J Califf; B Duffy, P Lynch, D McKenny; L Grey (0-1), N Sharkey (0-1), C Murphy; T Durnin, C Early (0-1); C McKeever (1-0), C Downey (0-2, 1m), C Grimes (0-2); C McCaul, S Mulroy (0-3, 3fs), A Williams.
Subs used: L Jackson for Williams (HT); C Lennon for McCaul (HT); R Burns for Lynch (50); P Matthews for Murphy (70).
Referee: N Mooney (Cavan)