St Mirren needed extra-time and penalties but eventually they booked their place in the semi-finals of the Scottish Communities League Cup following a 4-2 spot-kick win against Aberdeen after it ended 2-2 at 90 minutes.
Stephen Hughes crashed his penalty off the bar and substitute Cammy Smith saw his effort saved by Craig Samson as the Dons crashed out.
Twice the Buddies had led through goals from Sam Parkin and Kenny McLean, but first Scott Vernon and then, in injury time, Josh Magennis, levelled matters.
The home side were on the attack from the off and within the opening two minutes Russell Anderson saw a low shot from a Johnny Hayes corner come back off Gary Teale on the line, the St Mirren man in the right place at the right time.
Hayes had been restored to the Dons' starting eleven, along with Magennis, after his free-kick had been deflected in off Jim McAlister in the 2-0 win over Dundee at the weekend.
Danny Lennon had made three changes to his side, with midfielder McLean and the experienced duo of Parkin and Teale coming into the side.
Lewis Guy and former Celtic youngster Graham Carey dropped to the bench, while former Cowdenbeath man Jon Robertson missed out completely.
Despite Aberdeen's bright start, it was Lennon's men who took an early lead, and it was one of the trio restored to the side who did the damage.
Jamie Langfield could only push a Steven Thompson header onto the crossbar, and the ball fell kindly for Sam Parkin to fire home from close range.
The home side should have been level after 12 minutes. Hayes played a delightful back-heel into the path of Niall McGinn. His shot was beaten out by Craig Samson and landed at the feet of Vernon, only for the striker's effort to be deflected over the bar.
They would find an equaliser midway through the first half and it was Vernon who grabbed it, although Samson will be disappointed with his role in the goal.
The visitors had scrambled a corner as far away as Mark Reynolds on the halfway line, and his cross drew the keeper off his line. From the penalty spot, Vernon looped a header beyond the despairing grasp of the goalkeeper and into the net.
St Mirren, for their part, looked threatening in attack, but their defence was at times amateurish, inviting Craig Brown's men to attack them, and looking particularly uncomfortable at set-pieces.
The Aberdeen goal was under threat 10 minutes after the leveller. A Magennis foul on Thompson gave Jim Goodwin the chance to strike a low 20 yard free kick towards the bottom right corner, but Langfield was swiftly across his goal to turn the effort away.
Just after the half hour, McGinn cut in from the left saw his right-footed effort loop up into the air after a massive deflection off Goodwin, leaving Samson grateful to pluck the ball from the air just inches from his line.
It was a much more solid looking Buddies that emerged after the interval, and they showed the steel required to regain their lead.
Anderson saw his clearance blocked on the edge of the area, and McLean sent a superb first time strike beyond Langfield from the corner of the penalty area.
Buddies captain Goodwin became the first name to go into referee Crawford Allan's book when he was penalised for a foul on Magennis, and that would rule him out of the semi-final as he had been booked earlier in the competition.
With 12 minutes left the first change for either side saw Aberdeen introduce the pacy Fraser for Vernon, and five minutes later Smith replaced Clark Robertson.
Both were attacking changes, and they paid off in the second minute of injury-time when Magennis, now playing up front, turned home from close range after Samson had parried Smith's low strike.
That left St Mirren ruing the glorious chance Thompson passed up in the 90th minute, the former Scotland man having sent a diving header crashing off the post from Teale's cross.
St Mirren's nerves had returned, and early in extra-time Samson gave away a cheap throw from which Hughes found space and cracked a shot off the bar from 15 yards.
The pace of Fraser was a new threat, and he sparked a move after 95 minutes that eventually saw McGinn flash wide of Samson's left-hand post.
Substitute Guy had a golden chance to win in with the last kick of the ball but was adjudged to have dived as he tried to round Langfield, and was instead picked up a booking rather than the headline-grabbing goal.
The game then went to penalties and Samson made the decisive save.
People who read this story also read
- STV Sports Daily: Ref horror, Aberdeen for the title, Shiels masterclass
- Five things we learned from the 11th week of the Scottish Premier League
- Football Talk: Levein out, bye Bangura, Euro super league plan, Rangersitis
- Hibs working to extend loan deals for Griffiths, McGivern and Claros
- John Yorkston has 'no worries' for the immediate future of Dunfermline