Cillian O’Connor kicked 11 points including a nerveless 45 in the second period of added time to send Mayo into the All-Ireland quarter-final and past an heroic Cork at the Gaelic Grounds.

Second-half goals from Sean Powter and Luke Connolly kept Cork in the battle and Connolly forced extra-time with a 47 metre free in the 77th minute, but Keith Higgins, Diarmuid and Cillian O’Connor kicked the crucial late points for Mayo.

In front of 13,505 supporters at the Limerick venue, Cork looked the likely winners in extra-time as Paul Kerrigan landed a couple of great scores for his side, but in scorching heat Mayo held on for a memorable victory.

It would probably have been some relief to Peadar Healy to see his side come out early on and play like they did in the second-half against Tipperary rather than the rest of their championship season to date, but still they trailed by three points at the interval, as Mayo too found their best form of the summer.

It was like someone had rolled back the clock in the opening half an hour as Donncha O’Connor produce the form that helped his side to the 2010 All-Ireland title, and Mayo full-back Ger Cafferkey left the field at the break after having a tough time.

O’Connor’s first two points were frees as Cork ran into a 0-2 to 0-0 lead after seven minutes, but for his next two scores he lost Cafferkey and added the scores that Mark Collins’ and James Loughrey’s good work deserved.

Mayo were knocked back by the ferocity of Cork’s opening salvo, but with Aidan O’Shea and Colm Boyle ferocious in the tackle they tagged on points from Cillian O’Connor and a long range Lee Keegan point to stay in touch.

After 18 minutes Mayo had steadied themselves and were level when Tom Parsons and Andy Moran found the target, but Barry O’Driscoll soon had Cork ahead again when he made three runs to shake off Cafferkey before he pointed off John O’Rourke’s pass.

But as dominant as Cork were early on, Mayo were even better in the last ten minutes of the break, a period where they moved from one point down into a 0-10 to 0-7 interval lead.

All of a sudden their passing from the hand was quick and accurate, their kick passes found a man in space, and after long intricate moves Aidan O’Shea and Cillian O’Connor and Moran kicked three quick points.

Employing Aidan O’Shea as a willing line-breaker the points kept coming for Mayo. Paul Kerrigan and Donncha O’Connor responded with two good scores, but after Jamie O’Sullivan was black carded on the cusp of half-time, Cillian O’Connor’s third and fourth points gave Mayo the underhand.

Cillian O’Connor, Moran and sub Paddy Durcan kept Mayo stranglehold on the scoreboard as the first four points of the second half went Mayo’s way, but a couple of excellent John O’Rourke points – both of them followed by a clenched fist celebration – saw Cork’s challenge lift again.

Having gone 20 minute’s play without a score Cork landed four without reply, and it seemed as if Mayo had shaken off the Rebels when they hit three scores in as many minutes.

But a goal for Sean Powter and the black card for Keegan meant Cork’s confidence was soaring with 12 minutes remaining, and O’Rourke’s third point on the hour mark meant Cork only trailed by a point.

Cillian O’Connor responded again for Mayo with two points to open a three-point lead, which was devoured by Connolly’s goal in added-time. Durcan then pushed Mayo ahead, but Connolly’s 47 metre free sent the game into extra-time.

Buoyed by their late comeback, Cork were the better side in the first period of extra-time and a couple of Paul Kerrigan points saw them lead 2-19 to 0-24 after the ten minutes, but Keith Higgins fisted a point to level the game – the goal was at his mercy – and Diarmuid O’Connor drilled over a brilliant lead point from the right with seven minutes remaining.

A 45 from Cillian O’Connor gave Mayo a two-point cushion and Michael Hurley halved that two minutes from time, but this time Mayo held on to win.

Mayo: D Clarke; G Cafferkey, B Harrison, C Barrett; L Keegan (0-01), K Higgins (0-01), C Boyle; S O’Shea, T Parsons (0-01); K McLoughlin, A O’Shea (0-03), Diarmuid O’Connor (0-01); J Doherty (0-01), C O’Connor (0-11, 0-04 frees, 0-01 ‘45), A Moran (0-04).

Subs: P Durcan (0-02) for Barrett (44 mins), S Coen for S O’Shea (49 mins), D Vaughan for Boyle (53 mins), D Drake for Keegan (58 mins, black card), C Loftus (0-02) for Moran (63 mins), C Crowe for Cafferkey (80 mins), E Regan for McLoughlin (81 mins), A Dillon for Diarmuid O’Connor (87 mins).

Cork: R Price; J Loughrey, M Shields, J O’Sullivan; T Clancy (0-01), E Cadogan, C O’Driscoll; A Walsh, I Maguire; M Collins, S Powter (1-00), J O’Rourke (0-03); B O’Driscoll (0-01), P Kerrigan (0-03), Donncha O’Connor (0-06, 0-04 frees).

Subs: K Crowley for Loughrey (19 mins), S Cronin for O’Sullivan (35 mins, black card), R Deane for Walsh (37 mins), C O’Neill (0-03, 0-01 free) for Shields (46 mins), L Connolly (1-01, 0-01 free) for B O’Driscoll (53 mins), M Hurley (0-02) for Donnacha O’Connor (62 mins), S White for C O’Driscoll (71 mins), A O’Connor for Maguire (71 mins), K O’Driscoll for O’Rourke (71 mins), C Dorman for Crowley (75 mins), C O’Driscoll for Powter (80 mins).

Referee: Ciaran Branagan (Down)