Lewis Ferguson's stoppage-time overhead kick gave Aberdeen a dramatic win over Livingston to lift them into the top six of the Scottish Premiership.
The home side missed a host of second-half opportunities before Ferguson struck at the death.
Niall McGinn volleyed in to put Aberdeen in front early on.
Calamitous defending helped Livingston go 2-1 in-front through Scott Pittman and Jack McMillan before Sam Cosgrove's leveller set up a grandstand finish.
But the night would belong to Ferguson courtesy of his acrobatic winner, his second such goal of the season.
The result means Aberdeen are up to sixth, while Livingston drop to seventh.
Ferguson is creating a reputation for himself as Aberdeen's go-to man. Vital goals late in games against both Kilmarnock and Rangers have given Derek McInnes' side crucial victories, and so it was the case again at Pittodrie.
As a late corner was swung in the ball bounced in Ferguson's path, and he showed sublime technique and composure beyond his 19 years to acrobatically find the back of the net and send the Aberdeen fans wild.
It was much needed as Aberdeen had missed chance after chance in the second half as they pressed for victory.
Andrew Considine exemplified their wastefulness as he inexplicably nodded wide from six yards with the goal at his mercy, but he was not the only one.
Stevie May, Cosgrove, McGinn and Scott McKenna all squandered good chances from inside the box.
It was Cosgrove's cross which had teed up McGinn to brilliantly volley in the opener after nine minutes.
But Livingston battled back to lead at the break, albeit thanks to some generous Aberdeen defending.
Considine allowed a long ball to bounce, Craig Sibbald snuck in behind but was denied by Joe Lewis, only for the rebound to fall to Pittman, whose low strike hit a desperately lunging Considine and looped into the empty net.
And for Livingston's second McGinn was shrugged off the ball in his own half by Dolly Menga, who moved it to Pittman and then on to McMillan who showed great composure to skid the ball across Lewis and into the far corner.
Aberdeen rallied and Cosgrove grabbed the equaliser just before the hour mark, lashing in from close range after substitute Connor McLennan whipped the ball in from the right.
The visitors could not get out of their own half after the break, failing to register a shot on target, and they eventually succumbed to Ferguson's spectacular winner.
BBC Scotland's Tyrone Smith at Pittodrie
After Saturday's defeat to St Johnstone, McInnes wanted a response from his players. He certainly got it.
Trailing at the break, Aberdeen's second-half performance was like the Dons of old.
They had their swagger back, cutting Livingston open at will. More importantly, they showed buckets of character to turn around a game that looked like it could drift away from them.
Aberdeen are now back in the top six, and McInnes will be hoping this result can be the turning point that will see them stay there and move onwards and upwards.
It was a turnaround inspired by forward Connor McLennan - an old head on young shoulders - and the strike from Ferguson was fit to win any game.
His impressive showreel gets ever bigger.