Conor Whelan scored 1-02 as Galway edged past Cork after a nail-biting All-Ireland SHC quarter-final clash at FBD Semple Stadium.

The Tribesmen - who will now face reigning champions Limerick in the last four - went in front after 15 seconds thanks to a freak Jack Grealish goal, and survived a second-half fightback from the Rebels to qualify for the semi-finals.

The sides last met in championship action at this stage and on this field in 2015, with Galway cantering to victory after Johnny Glynn marched through for an easy goal.

It came via a different route here, but calamity again befell the Rebels as a mishit long-range pointed effort by corner-back Grealish dropped into the net past goalkeeper Patrick Collins.

Cork could have undone the damage right away but Alan Connolly's low shot was beaten away by Eanna Murphy.

It kickstarted what was a frustrating first half for the Leesiders, as they converted just seven of 25 scoring opportunities.

Patrick Horgan had been dropped for the win over Antrim, and his absence was keenly felt during the first half as Conor Lehane and Mark Coleman squandered a number of placed balls.

Robbie O’Flynn missed another goal chance on 20 minutes, shooting from the '21 when he could have fed Shane Kingston to walk it home.

Henry Shefflin’s forward line were shocking in the Leinster final against Kilkenny, with Whelan the only attacker to come away with credit.

After an unusual lofted ball into the ‘21 by Tom Monaghan caught out Sean O’Donoghue on 18 minutes, the Kinvara man stole in to win the ball and finish low from near the endline.

Cork responded through a long-range Damien Cahalane score, and then Darragh Fitzgibbon had another goal attempt blocked by Murphy after a lovely touch-and-handpass assist by Tim O'Mahony.

Sidelines, frees and '65s all went awry for the Rebels and on three occasions they were forced into fouling the ball, all of which added to a sense of frustration in the crowd.

Cork's Alan Connolly in action against Galway's Darren Morrisey

Galway were little better but points from Ronan Glennon, Whelan, Davy Burke and Joseph Cooney kept the scoreboard ticking over.

O’Flynn, Harnedy, Kingston and Coleman all registered further misses to go with the three poor goal attempts during the half as the Tribe went in 1-06 to 0-07 ahead.

Some life was injected into proceedings on 39 minutes when Kingston chopped the ball out of a ruck inside the Galway D, and set off inside the cover to stretch the net — 1-07 to 2-06.

As ever, the Tribe had a response and scored with 13 of their next 16 attempts to ensure the Rebels were always chasing the game.

Fitzgibbon hit over a couple of nice points, O’Flynn and Meade made their mark, while Coleman and Horgan also raised white flags for the Leesiders.

There was a feeling that Cork might have kicked on had they managed to draw level at any stage, but substitutes Jason Flynn, Brain Concannon and Johnny Coen all found the range to stem the tide for Galway.

Alan Cadogan also fired over three scores of his own and Horgan took his tally to four as the Rebels got it back to the minimum deep into injury time, but Galway held on to keep their All-Ireland hopes alive.

Galway: Éanna Murphy; Jack Grealish (1-00), Daithí Burke, Darren Morrissey; Gearóid McInerney, Padraic Mannion, Fintan Burke; Joseph Cooney (0-02), David Burke (0-02); Ronan Glennon (0-01), Conor Cooney (0-04; 0-03f, 0-01 ‘65), Tom Monaghan (0-01); Conor Whelan (1-02), Cianan Fahy, Cathal Mannion (0-04).

Subs: Brian Concannon (0-01) for Fahy (30); Jason Flynn (0-01) for McInerney (34); Johnny Coen (0-01) for Glennon (45); Evan Niland for David Burke (69); Gavin Lee for Monaghan (74).

Cork: Patrick Collins; Damien Cahalane (0-01), Robert Downey, Sean O'Donoghue; Niall O'Leary, Ciarán Joyce, Mark Coleman (0-03; 0-02fs, 0-01sl); Darragh Fitzgibbon (0-03), Luke Meade (0-01); Robbie O'Flynn (0-03), Séamus Harnedy, Shane Kingston (1-02; 0-01f); Tim O'Mahony, Alan Connolly, Conor Lehane (0-01f).

Subs: Patrick Horgan (0-04; 0-02fs, 0-01 ‘65) for Lehane (ht); Jack O'Connor for Connolly (47); Ger Millerick for Downey (51); Alan Cadogan (0-03) for O’Mahony (58); Tommy O'Connell for Harnedy (67).

Referee: Paud O’Dwyer (Carlow).