Sam Cosgrove converted two spot-kicks in normal-time before missing in the decisive penalty shoot-out as Hearts progressed to the semi-final of the Betfred Cup at the expense of Aberdeen.
Cosgrove netted a double from the spot in the first-half after Christophe Berra and Loic Damour had committed clumsy fouls.
However, strikes from Steven MacLean and an injury-time leveller from Craig Halkett sent the clash into extra-time, during which Dons attacker Niall McGinn struck the post.
But it was the Jambos who would progress in a fraught shoot-out, with Cosgrove and McGinn blasting woefully over the bar and Joel Pereira saving Bruce Anderson’s kick.
Glenn Whelan, Michael Smith and Aidan Keena all converted to tee up a date at Hampden against Rangers.
It took the home side just 38 seconds to rattle the woodwork as Hearts exploded from the blocks.
Uche Ikpeazu took advantage of some sleepy Dons defending to hare through on goal – but his curling shot hit the under-side of the bar and he could only head the rebound wide.
Just a minute later, the hugely exciting Ryotaro Meshino cut in from the right flank and stung the palms of Joe Lewis with a ferocious drive following a wonderful crossfield pass by Whelan.
Hearts’ bright start counted for nothing when Berra hauled down Ryan Hedges as the winger tried to control a bouncing ball inside the penalty area. Referee Kevin Clancy pointed to the spot and Cosgrove sent Pereira the wrong way.
Aberdeen’s lead lasted just 12 minutes as more lamentable defending allowed the Jambos to restore parity. Devlin inexplicably failed to cut out a hopeful delivery into the danger area, affording MacLean all the time and space in the world to slot home from 10 yards.
A breathless first period saw Hearts again fall behind to due to an avoidable error as Damour tripped James Wilson inside the box as the striker sought to latch onto a Hedges pass. Again, Clancy awarded the penalty and Cosgrove made no mistake.
The visitors came close to doubling their advantage after the break when Greg Leigh fizzed a low shot inches wide of the post and, with the away fans serenading Craig Levein with a rendition of ‘sacked in the morning’, Hearts appeared to be running out of ideas.
However, Halkett popped up two minutes into added time to head home a sensational inswinging cross from winger Jake Mulraney and send the game into extra-time.
McGinn was presented with a glorious opportunity to settle the contest during a fraught period of extra-time when he met a Jon Gallagher cross, but the Northern Ireland international saw his header came back off the base of the post.
Having held on for penalties, it was the Jambos – in sharp contrast to Aberdeen – who held their nerve with three superbly dispatched efforts.