Thoroughly outplayed by Dunfermline Athletic for the majority of a compelling match, for once it was the turn of the Pittodrie side to spring the surprise.
With more than two minutes of injury time played, the visitors pushed forward once more, hoping to avoid extra time. Gavin Rae spread a fine pass wide to Niall McGinn, whose cross was enticing, inviting a touch. Substitute Scott Vernon duly delivered, thrashing the ball beyond Paul Gallacher and Aberdeen, somehow, had booked their place in the quarter-finals of the Scottish Communities League Cup.
It was cruel on Dunfermline, who dominated possession and created the bulk of the chances only to lack a killer touch. However Aberdeen may feel that, after years of being embarrassed by the likes of East Fife, Queen of the South, Queen's Park and Raith Rovers, they were due a change of fortune, the victory keeping alive their hopes of reaching a fourth semi-final in three seasons and perhaps a first trophy since 1995.
They are, at least, showing a degree of perseverance. Having come from behind to snare late draws in recent matches against Inverness Caledonian Thistle and Motherwell, they again refused to throw in the towel and were belatedly rewarded for sticking to their task.
"I'm delighted we managed to squeeze through," manager Craig Brown said. "We were down at Inverness and fought back and the same again when we were two down against Motherwell but came back to get a point. Tonight we were up against a team flying high with five wins on the spin and we managed to succeed."
There was sympathy, too, for his defeated counterpart. "I'd be disappointed and upset if I was Jim Jefferies. That was a far better Dunfermline team than the one relegated last season and any SPL team playing them in the cup would have had great difficulty."
On that point it was hard to disagree. Dunfermline had often seemed ill at ease last season but appear revitalised. Well placed in the Irn-Bru First Division, tucked in just behind leaders Partick Thistle, their burgeoning confidence was apparent as they played with the sort of swagger that only winning regularly can bring.
It was something of a surprise they didn't have a lead by half-time as their play more than merited it. They did come close on a number of occasions, none more so than when an Andy Barrowman shot cannoned off a post. By then they had had a penalty claim waved aside, John Beaton decreeing that Rae's mistimed lunge on Joe Cardle had taken place just outside the box. "The players were claiming it was in the box so I would like to see that on the video again," said Jefferies. "It have could been trouble for Aberdeen because it could have led to a sending off."
Brown, unsurprisingly, claimed not to have had a good view. "I'm not trying to have selective eyesight or be Arsene Wenger," he said.
When the ball was laid down for the free kick Ryan Wallace could only lash it into the wall. There were other near things but Aberdeen survived them all. Jamie Langfield pushed away a Stephen Husband shot and watched another Wallace effort drift wide, while Cardle's mazy run culminated in a bending shot that arced just the wrong side of a post. The same player would later be denied by Langfield, the goalkeeper pushing his shot on to the bar.
Aberdeen, in contrast, were sterile, creating little and seemingly content to soak up pressure and counterattack. From one such move they should have garnered the lead. Cameron Smith sent McGinn haring through and as Gallacher hesitated, the Northern Irishman could only steer his shot over the bar. Aberdeen became bolder in the second half, although Johnny Hayes could only sidefoot a volley straight at the goalkeeper.
The Irishman was removed soon afterwards, Brown throwing on Vernon to try to belatedly add a focal point to his attack. It didn't make an immediate difference – in his first real chance Vernon could only sky into the Aberdeen fans gathered behind the goal – but his moment in the spotlight would arrive later in the game, turning in McGinn's cross to spark jubilation among the Aberdeen fans. They have seen it go the other way often enough.