Hurling, bloody hell.

Cork will play Limerick in the All-Ireland final for the first time after edging Kilkenny in an enthralling epic at Croke Park.

Both teams took the 24,000 fans in attendance on an emotional rollercoaster, Cork finally finishing the job after their opponents had fought back from the dead to force extra-time.

The Rebels had looked in control with a six-point lead in the closing stages, after immense performances from Patrick Horgan (0-15, 9f) and sub Shane Kingston (0-07), until Kilkenny captain Adrian Mullen forced another 20 minutes with a last-second goal that made it 1-26 to 0-29.

Cork fans must have feared it was 2018 all over again but their team gathered themselves admirably after that body blow and took control once more, Jack O'Connor scoring a crucial goal that set the platform for a deserved victory.

The Leesiders are back in the All-Ireland final for the first time since 2013 and seeking their first Liam MacCarthy Cup since 2005.

For Brian Cody, it’s just a fourth semi-final defeat in 20 appearances at this stage, and the first time ever that Kilkenny have lost in consecutive years in the last four.

The sides had been level seven times in a gripping first half.

A lengthy schemozzle before the throw-in roused passions but it was Kilkenny who settled first, Richie Reid and Padraig Walsh scoring as their more possession-focused style paid dividends.

Cork looked nervous and the tactic of getting goalkeeper Patrick Collins to advance after a short puckout wasn’t working. Kilkenny picked the ball off more than once and when Eoin Cody got his second in the 11th minute, the Cats were 0-06 to 0-02 ahead.

TJ Reid could also have been awarded a penalty but Fergal Horgan decided the Kilkenny man had over carried despite Mark Coleman laying hands on him.

The Rebels responded by hitting the next five scores in a row, mostly from Horgan frees after fouls by Paddy Deegan, who saw yellow for catching Tim O’Mahony high while stretching for the ball.

Kilkenny hit back with two in a row from Billy Ryan, his second after dancing around Robert Downey, and TJ’s second free to lead 0-09 to 0-07 but Cork finally started to get their running game going,

Darragh Fitzgibbon and Shane Barrett were on target, and 33-year-old Horgan started to cut loose, hitting three fantastic scores from over his shoulder as Cork inched back in front.

Robbie Flynn (0-02) aside, Horgan was taking on most of the scoring burden for Cork but while Reid was mostly limited to frees, Mullen (1-03), Eoin Cody (0-04) and Billy Ryan (0-05) seized the day. All three Kilkenny half backs were also on target.

Cody did hit a goal chance too close to Collins but Kilkenny had the minimum advantage at half-time, 0-15 to 0-14.

The momentum continued to veer wildly after the interval. Kilkenny ominously moved four clear with a succession of Reid frees but Horgan and O’Flynn kept Cork in touch.

Shane Kingston scored 0-07 off the bench

Kieran Kingston had already been forced to replace hamstring injury victim Ger Millerick before half-time and reacted quickly as the game seemed to be slipping away from his team.

Kingston’s son Shane and Alan Cadogan (0-03) were introduced with Cork trailing but their pace and finishing meant Cork had levelled – 0-21 apiece – by the second water break, though Collins was grateful to Niall O’Leary for a goal-line clearance after being caught in possession.

Huw Lawlor made a superb block to deny Cadogan a goal but he and the superb Kingston, especially, were rampant now, and Cork scored six unanswered points between the 55th and 64th minute.

Kilkenny don't know what surrender means and Reid sniped from long-range to keep them in touch, but even when Horgan missed a stoppage-time 65 it looked too little late.

The clock was into the 75th minute when the otherwise excellent Tim O’Mahony lost possession, Padraig Walsh picked out Mullen on the edge of the square and he crashed the ball to the net. Extra-time.

With memories fresh of the demolition job Kilkenny had done on Wexford in the extended Leinster semi-final, the feeling was this game was theirs for the taking. Wrong.

Both teams started hunting for goals: Collins tipped over a Ryan shot before Martin Keoghan and Walter Walsh hit the side-netting, and Murphy was smartly off his line to deny Alan Connolly.

Cork found one first. O’Connor, who was perhaps lucky not to be taken off after an ineffectual first 45 minutes, had seen a shot turned onto the post by Murphy in normal time, but there was no stopping the fierce angled drive he unleashed after leaving two Kilkenny defenders for dead shortly before midway in extra-time – 1-32 to 1-29.

Kilkenny brought on Richie Hogan but even a point-scoring cameo from the former Hurler of the Year couldn't spark a second comeback.

O’Connor finished with 1-03 as his team extended that three-point advantage to five by the finish, and Kingston capped one of the all-time great substitute displays with a seventh score.

Winning the same game twice is some way to break a three-match semi-final losing streak.

They’d settle for doing it once against Limerick.

Kilkenny: Eoin Murphy; Tommy Walsh, Huw Lawlor, Paddy Deegan; James Maher (0-01), Padraig Walsh (0-01), Michael Carey (0-01); Conor Fogarty (0-01), Richie Reid (0-01); Adrian Mullen (1-03), John Donnelly, Billy Ryan (0-05); Eoin Cody (0-04), TJ Reid (0-13, 3 '65s’, 9f), Alan Murphy (0-01).

Subs: Cillian Buckley for Richie Reid (50), Martin Keoghan for Donnelly (ht), Walter Walsh for Murphy (52), James Bergin for Keoghan (60), Richie Hogan (0-01) for Cody (et), Donnelly for Ryan (et), Delaney for Carey (et)

Cork: Patrick Collins; Niall O'Leary (0-01), Robert Downey, Sean O’Donoghue; Tim O’Mahony, Mark Coleman (0-01), Ger Millerick; Darragh Fitzgibbon (0-01), Luke Meade; Conor Cahalane, Seamus Harnedy (0-02), Robbie O’Flynn (0-02); Shane Barrett (0-01), Patrick Horgan (0-15, 9f), Jack O'Connor (1-03).

Subs: Eoin Cadogan for Millerick (35), Shane Kingston for Fitzgibbon (0-07) (42), Alan Cadogan (0-03) for Barrett (47), Damien Cahalane for O’Flynn (68), Alan Connolly for C Cahalane (et), Sean O’Leary Hayes for Coleman (et), Fitzgibbon for Meade (et), Declan Dalton for O’Connor (0-01) (et)

Referee: Fergal Horgan (Tipperary)