Conor Mortimer's last-gasp free saw Mayo win their second Connacht SFC title in three seasons, as defending champions Galway were beaten by 0-12 to 1-08 in a Castlebar cliffhanger.

Mortimer cracked over an injury-time free from the right wing to spark premature celebrations amongst the sell-out crowd. In the dying seconds, Galway skipper Michael Donnellan had a free of his own, but it fell away to the left and wide.

Galway led 0-05 to 0-04 at the break as a Mayo side, who dominated possession but failed to make it show on the scoreboard, conceded late points from Michael Meehan (0-02) and Sean Armstrong.

Matthew Clancy's 43rd-minute goal helped Galway go four points clear but Mayo wrestled the Nestor Cup back with Mortimer's fourth and most vital point dramatically deciding a second-rate final.

The first half was a shockingly bad advertisement for Connacht football – the 34,613 present must have wondered just exactly why they had forsaken their back gardens and the west's sun-laced shores on one of the hottest days of the summer.

Playing against the breeze, Mickey Moran's men had the guts of the possession but an end product was missing time and again.

Mayo were guilty of nine wides in the opening period – Galway hit six – and while Mayo's taller midfield tandem had Brian O'Donoghue in trouble on his kick-out, the Tribesmen conceded just one point from play in the entire first half.

O’Donoghue's luck, which saw him avoid a serious neck injury in a recent game for Claregalway, continued when Mayo missed the only real goal chance of the first half – 22 minutes in.

The young Galway 'keeper foolishly tried to keep a wayward shot from Ciaran McDonald in play. He dropped it straight into the jaws of the lurking Mortimer but the Mayo full-forward's palmed effort danced frustratingly across an empty goal line and into the arms of Alan Burke.

Galway started Caherlistrane's Cormac Bane on the 40 after Derek Savage failed a fitness test on his leg and their first noteworthy attack saw the fit-again Joe Bergin clip over an eighth-minute opener.

Padraic Joyce added a fortunate second when his shot dropped short but bounced up off the hard ground and over John Healy's crossbar.

Mortimer, who was operating in an underused two-man full-forward line with Andy Moran, sent over Mayo's first point from a twelfth-minute free, but a series of wides followed with Peadar Gardiner, on a trademark run, notching Mayo's sixth of the afternoon after only 17 minutes.

Moran opened up the Galway rearguard with a neat centre but O'Donoghue always had Mortimer's fisted shot under control. He was all at sea moments later when he flailed under McDonald's speared shot – Mortimer just failed to take advantage.

Two booming 45s from McDonald, who had taken up residence in the middle of McHale Park, and a curling shot from Mortimer pushed Mayo 0-04 to 0-02 in front but Galway's forwards, starved of possession, conjured up three late points to nose their side in front.

Meehan sent over a '45 and a towering point to level the sides for the second time, and Sean Armstrong's injury-time effort – the Salthill-Knocknacarra star unfortunately injured his hamstring in the process of scoring – saw Galway move 0-05 to 0-04 ahead for the break.

Points from Pat Harte and Mortimer, who made use of an instinctive diagonal ball from substitute Kevin O'Neill to score, sandwiched a Joyce free at the start of the second half before Clancy crept through for his goal.

Damien Dunleavy's through ball deceived Mayo corner-back Dermot Geraghty and Clancy flashed onto it, diverting the ball around Healy with his left hand and into the Mayo net. A Joyce free handed Galway a 1-07 to 0-06 lead and Mayo looked in some danger.

But showing a steely determination, Moran's side grabbed the next three points from the bulldozing Ger Brady, Alan Dillon (free) and Billy Joe Padden, who did well to out-muscle Michael Comer before fisting over, to close the difference up to 1-07 to 0-09. The football had been taken up a notch, as had the decibel level.

Bane fired over and Dillon added his second free in the 57th-minute as the one-point gap was maintained, setting up a furious finale.

With just four minutes remaining, the powerful O'Neill, an All Star way back in 1993, sent over a rousing equaliser, and while Galway had their chances to win it before the 70 minutes was up – Paul Clancy hit an upright and Donnellan chipped to the left and wide from play – Mayo were also guilty.

Midfielder Harte toe-poked to the right as the clock ticked towards injury-time. The game was in the third minute of added time when the pacy Padden suddenly drew a foul from Finian Hanly and Mortimer, displaying an enviable nerve, left-footed it over to squeeze his side in front.

Just moments later, Donnellan was adjudged to have been fouled by Mayo captain David Heaney when collecting a centre from Declan Meehan. The hero of Salthill-Knocknacarra's run to the All-Ireland title this year, Donnellan dusted himself off to eye up the free. It tailed away to the left and with that, Galway’s reign was over.

The quality may have been poor, but Moran and his players were overjoyed – it was only Mayo's second win in their last five championship meetings with their old rivals.

Mayo: J Healy; D Geraghty, L O'Malley, K Higgins; D Heaney (capt), J Nallen, P Gardiner; R McGarrity, P Harte (0-01); BJ Padden (0-01), G Brady (0-01), A Dillon (0-02 (2f)); A Moran, C Mortimer (0-04 (2f)), C McDonald (0-02 (2 '45)).

Subs used: B Moran for Nallen (23-26 mins, 60-62 mins, blood sub), K O'Neill for Moran (33), T Mortimer for Brady (57)

Galway: B O'Donoghue; A Burke, F Hanly, D Burke; D Meehan, D Blake, M Comer; N Coleman, M Donnellan (capt); M Clancy (1-00), C Bane (0-01), J Bergin (0-01); M Meehan (0-02 (1 ‘45’)), P Joyce (0-03 (2f)), S Armstrong (0-01).

Subs used: D Dunleavy for Armstrong (35+1 mins), B Cullinane for Coleman (43 mins), K Fitzgerald for A Burke (53 mins), P Clancy for Dunleavy (63)

Referee: Paddy Russell (Tipperary)