Cork came from five points behind to score a narrow 1-17 to 1-16 All-Ireland football round four qualifier win over Galway at Croke Park.
Four Michael Meehan points helped Galway to a 0-08 to 0-07 lead, but they needed a superb Manus Breathnach save to deny Pearse O’Neill.
Breathnach pulled off two more saves, but Cork did find the net in the 65th minute through Aidan Walsh.
Meehan’s late goal direct from a free was too little to save a brave Galway effort.
James Loughrey burst through from deep to kick Cork into an early lead, but Paul Conroy’s threaded pass sent Danny Cummins to bring Galway level.
With both teams set up defensively, scoring opportunities were difficult to carve out, but the Rebels did have a glorious goal chance when Aidan Walsh smashed a fiercly struck shot against the crossbar, after trading passes with Brian Hurley.
Pearse O’Neill and John O’Rourke stroked over points as the Munster men eased ahead, but with Conroy giving them presence and leadership around midfield, the Tribesmen displayed grit and tenacity that had been sadly absent earlier in the campaign, and took the challenge to the pre-match favourites.
Sean Armstorng an Michael Meehan both split the posts with stylish efforts, and Alan Mulholland’s men were performing with a new-found assurance and confidence.
Even when Walsh and Damien Cahalane, from a ’45, restored Cork’s two points cushion, the Westerners were able to counter with three quality scores to go ahead for the first time, two of them from the excellent Meehan.
But Cork always carried a goal threat, and were denied for a second time when Manus Breathnach dived to his left to push away Pearse O’Neill’s shot.
Finian Hanley, Donal O’Neill and Gary Sice defended solidly as Galway surived another spell of pressure, and eased two points clear with an Armstrong free.
They led by one, 0-08 to 0-07, at the interval, but once again goalkeeper Breathnach had to come to their rescue early in the second half with a splendid stop from Mark Collins, after Graham Canty and Goulding had combined to prise open the Galway defence.
The Tribesmen eased into a four-points lead with scores from Meehan, Armstrong, Conor Doherty and Conroy, with Cork struggling for possession and finding the in-form Meehan impossible to contain.
And they continued to waste chances, another goal going abegging when Ciaran Sheehan slid a low shot wide of a post.
With ten minutes of the second half played, Cork trailed by five and looked to be in deep trouble.
The introduction of Paul Kerrigan gave them more dash and urgency, and they narrowed the deficit with frees from Goulding and Hurley.
But for the third time, Breathnach produced heroics to come off his line and smother a Hurley shot, after Aidan Walsh had sliced through a hesitant Galway defence.
Ciaran Sheehan narrowed the gap to a single point, but once again, Galway went on the offensive, and Armstrong and Meehan shot them into a three points lead at 0-16 to 0-13.
But they continued to cough up goal chances at the other end, and survived again when O’Neill saw a shot come back off the butt of a post.
But almost inevitably, Cork did find the net in the 65th minute, O’Neill crossing for Walsh to punch home and break Galway hearts.
With momentum in their favour, they powered on with points from O’Neill, Goulding, Sheehan and full-back Michael Shields to lead by four.
Cork courageous effort was spent, even though Meehan did smash home a goal from a 13 metre free in stoppage time.
Cork: A Quirke, E Cadogan, M Shields (0-1), T Clancy, D Cahalane (0-1, ’45), G Canty, J Loughrey (0-1), A O’Connor, P O’Neill (0-2), M Collins (0-1), A Walsh (1-1), J O’Rourke (0-1), D Goulding (0-5, 4f), C Sheehan (0-2), B Hurley (0-2, 2f).
Subs: P Kerrigan for O’Rourke, P Kissane for Loughrey, D O’Connor for Hurley, P Kelly for A O’Connor, J O’Sullivan for Clancy
Galway: M Breathnach, D O’Neill, F Hanley, J Duane, S Denvir, G O’Donnell, G Sice (0-1), P Conroy (0-2), T Flynn, J O’Brien, S Armstrong (0-4, 1f), C Doherty (0-1), M Martin (0-1), M Meehan (1-6, 1-3f), D Cummins (0-1).
Subs: S Walsh for Cummins, M Farragher for O’Brien, F O Curraoin for Flynn, A Varley for Martin
Referee: D Gough (Meath).
Highlights and analysis of all the weekend’s action on The Sunday Game from 21:30 on Sunday 28 July on RTÉ Two and RTÉ.ie (Ireland only). Expert and fan reaction on Take Your Point from 18:00 on RTÉ Radio 1 and RTÉ.ie (Worldwide).