James Horan suffered his first championship defeat in seven meetings as Mayo manager to arch rivals Galway as a late comeback came up short in Castlebar as the Tribesmen held on in thrilling finish to win by 1-14 to 0-16.

Galway led by six points with two minutes of regular time left before Mayo finally got moving as Lee Keegan, Ryan O'Donoghue, Kevin McLoughlin and Cillian O’Connor, with a couple of frees, hit points to cut the gap to the minimum.

But Mayo were unable to get level in five minutes of injury-time with sub Aiden Orme wide with an ambitious effort from the left in the final play of the game.

Galway did enough to hold out with Liam Silke, Jack Glynn and Kieran Molloy outstanding in a defence which smothered the Mayo attack and forced them into shooting 11 wides.

The sides went in level at the break at 0-09 to 1-06 after Mayo recovered from a blistering start by Galway, who opened up a five points lead by the tenth minute.

It took Shane Walsh just 14 seconds to get the Tribesmen off the mark but Cillian O’Connor quickly levelled with a free.

Galway pushed on with Rob Finnerty and Niall Daly shooting good points before Johnny Heaney ran on to a pass from Damien Comer and finished the ball low to the net after seven minutes.

Ryan O’Donoghue stemmed the flow when he pointed from a mark but Comer hit back for Galway when he knocked down a free from Conroy and shot over the bar to make it 1-04 to 0-02 after ten minutes, with five of the Tribesmen forwards scoring from play by that stage.

But Mayo did not panic and took the game to Galway with some strong running. O’Connor kicked two more frees after good turnovers before their first point from play came when Eoghan McLaughlin went forward and pointed after 20 minutes.

Galway wing-forward Finnian Ó Laoí picked up a black card for pulling down O’Connor after another turnover and Mayo outscored the Tribesmen by 0-04 to 0-02 while they had the extra man.

Diarmuid O’Connor, a late replacement for Kevin Mcloughlin, edged Mayo in front for the first time after 23 minutes with a very good point from the left before Walsh ended a 16-minute barren spell for Galway when he slotted a free after he himself was fouled.

O’Donoghue landed two in a row for Mayo before Conroy hit back for Galway but the Green and Red then levelled with a point from James Carr after Jason Doherty had a goal chance blocked down.

Carr got a second point two minutes after the restart but this was cancelled at the other when wing-back Kieran Molloy went forward to score.

Mayo lost full-back Oisín Mullin to a hamstring injury and Galway pushed on to score the next five points, three of them from Walsh. He landed two 45’s and also pointed a free, while sub Cillian McDaid made an instant impact when he came on to score.

Then Conroy burst through for his second point to push Galway into the lead by 1-12 to 0-10 after 57 minutes.

O’Connor got Mayo’s first score in 22 minutes when he landed a good free from 45 metres on the left but the next two scores came from Galway with Comer running from deep after good work by Jack Glynn and Conroy supplied the finish, before Heaney finished another good move to extend the lead to six points.

Then came the late Mayo rally but they were unable to haul back their arch rivals and now face the qualifiers as Galway advance to a Connacht semi-final meeting with Andy Moran’s Leitrim.

Galway: Conor Gleeson; Liam Silke, Seán Kelly, Jack Glynn; Dylan McHugh, John Daly, Kieran Molloy (0-01); Paul Conroy (0-03), Matthew Tierney; Finnian Ó Laoí, Niall Daly (0-01), Johnny Heaney (1-01); Rob Finnerty (0-01), Damien Comer (0-01), Shane Walsh (0-05 (0-02f, 0-02 '45))

Subs: Patrick Kelly for N Daly (half-time), Cillian McDaid (0-01) for Ó Laoí (45), Dessie Conneely for Finnerty (49), Paul Kelly for Tierney (65), Johnny McGrath for Glynn (66).

Mayo: Rory Byrne; Lee Keegan (0-01), Oisín Mullin, Pádraig O Hora; Stephen Coen, Michael Plunkett, Eoghan McLaughlin (0-01); Aidan O’Shea, Mattie Ruane; Diarmuid O'Connor (0-01), Ryan O'Donoghue (0-04 (0-01m)), Conor Loftus; James Carr (0-02), Jason Doherty, Cillian O'Connor (0-06 (0-06f))

Subs: Enda Hession for Mullin (39), Aiden Orme for Doherty (49), Jack Carney for Loftus (58), Kevin McLoughlin (0-01) for Coen (63), Darren McHale for Carr (67).

Referee: David Coldrick (Meath).