Last updated on .From the section Scottish Cup

Scottish Cup highlights: Kilmarnock 3-4 Aberdeen

Aberdeen struck twice in the final two minutes of extra time to knock out Kilmarnock in a belatedly thrilling Scottish Cup replay and set up a quarter-final with St Mirren.

The Pittodrie side trailed with two minutes of the 90 to play, and again as the game entered its 119th minute. But Sam Cosgrove's penalty and a Connor Johnston own goal clinched victory.

It looked as if Mohamed El Makrini's overhead kick, then Nicke Kabamba's goal, would win the tie for Kilmarnock, but Aberdeen somehow snatched it.

Andy Considine had cancelled out El Makrini's first-half opener and Matty Kennedy headed Aberdeen ahead inside the first minute of extra time.

Eamonn Brophy's free-kick restored parity for Kilmarnock before three goals in the final four minutes earned Aberdeen a tie in Paisley on February 29 at 19:20 GMT live on BBC Scotland.

McInnes' Hail Mary sparks drama

After the bonkers drama at Fir Park the previous evening, when St Mirren progressed on penalties after a topsy-turvy 4-4 draw, there was little evidence a repeat of the chaos was on the cards.

After all, these teams had already shared two goalless draws this season - including the first tie - and there had only been more than two goals in two of their last 10 meetings.

The first-half was forgettable - El Makrini's superb acrobatic opener aside - as Kilmarnock deservedly led at the break.

This match had the sense of a season-definer for Aberdeen, having tested fans' patience with a poor start to 2020 before a win against Hamilton Academical and a battling performance in defeat by Celtic earned them some respite.

And the risk taken by Derek McInnes in introducing Sam Cosgrove, Shay Logan and Dean Campbell for Craig Bryson, Dylan McGeouch and Connor McLennan at the break was the Hail Mary move that transformed the match.

The visitors upped the tempo significantly, with Niall McGinn and Kennedy causing problems as crosses peppered the Kilmarnock box, but the hosts, as is their speciality, held a piercing threat on the break.

Brophy twice had the chance to bury the tie, first ghosting through only to be superbly denied by Lewis, and then curling just wide with 10 minutes left after a swift counter-attack.

Aberdeen's attacking strategy consisted mainly of balls into the box, McGinn's toe-poked volley just past a post aside, and as desperation grew they left themselves increasingly open, but had little choice in pursuit of the crucial equaliser.

And fortunately for them, having just missed an easier chance, Considine glanced the ball into the net from McGinn's cross to salvage extra-time. Mind you, that might not have needed had Brophy not lashed another clear opening over, and Cosgrove's header not rattled the crossbar at the death.

Mohamed El Makrini's overhead kick looked like winning the tie

The great escape to save season?

The full-time whistle allowed the increasingly frantic crowd inside Rugby Park to draw some breath. But it was just the beginning. The fleeting silence did not last long as Kennedy nodded Aberdeen in front inside a minute of extra-time, as the momentum seemed to lie with the visitors.

But Brophy, having been suspect with his finishing, produced the goal his relentless work rate deserved as he jolted the home crowd back to life by caressing a free kick past Lewis, before cannoning a shot from the edge of the box off a post minutes later.

Weary legs set in and quality became at a premium and there was a brief lull, before the incredulousness of the match continued when Aberdeen substitute Mikey Devlin made a hash of a clearance, allowing Kabamba to finish from close range.

But back came Aberdeen, their season on the line, and when Lewis Ferguson was brought down in the box, up stepped Cosgrove to slam home his ninth spot-kick of the season to seemingly set up another nerve-shredding shootout.

But, having conceded late on in normal time, Kilmarnock were suckered again in the most painful fashion as the travelling support cascaded down the stands in joy.

Considine, who grew as an attacking force throughout the game, fired in a low cross which cannoned off young substitute Johnson and into the net.

It was a punch in the gut for Kilmarnock, as the 5,000 home fans immediately traipsed out. As for Aberdeen, it was the great escape that might just have saved their season.