An injury-time strike from Rory Boulding fired Dundee United into the Scottish Premier League's top six.
With Kilmarnock suffering defeat, victory for either side at Tannadice would guarantee a top-half finish.
And, after a pulsating match that looked like ending goalless, former Killie player Boulding tucked home a decisive winner.
Craig Brown signs off as Aberdeen manager with defeat with Derek McInnes taking over for the post-split games.
The tempo was high as both sides hoped for the combined effect of a win and a slip-up by Killie against Dundee.
Dons captain Russell Anderson rose highest to head just wide, but was almost the villain at the other end seconds later as a mix-up between himself and goalkeeper Jamie Langfield allowed Ryan Gauld to race through and lob wide.
Josh Magennis pick-pocketed John Souttar to allow Aberdeen to race forward in numbers, but Jonny Hayes fired the eventual shot over.
At the other end, Willo Flood's cute through ball fed Michael Gardyne only for the forward to drag his shot across goal.
The action continued to rage from end to end as half-time approached but neither side managed to force a meaningful save from the keepers.
Jon Daly really should have tested Langfield when he peeled away from his marker and scooped his shot over from short range.
It was the visitors who were first to threaten in the second half. Hayes crossed from the right and on-form Niall McGinn flicked a header straight at Radoslaw Cierzniak.
After that though it was United who were well in control.
Anderson and Joe Shaughnessy got in each other's way allowing substitute Gary Mackay-Steven to stroll through one-on-one with Langfield, but Mark Reynolds raced back to get a foot in to save Aberdeen.
From the corner, Keith Watson headed just over.
Gauld then cut inside Shaughnessy and fired a stinging shot at Langfield. The stopper could not hold it and the ball ricocheted off Willo Flood onto the bar and then into the path of Mackay-Steven, who could not convert.
Langfield was keeping Aberdeen in the game and he clawed off the line from Watson's header and made a superb stop from Gauld.
Peter Pawlett, Niall McGinn and Rory Fallon all went close for the Dons as time ticked away, while Watson and Daly both threatened at the other end.
And it was United who had the final say. Scott Vernon dithered on the ball and his poor clearance gifted Boulding the chance to finally break Langfield's resistance.