There were three changes to Stephen Glass' side from the side that slipped to late defeat against Celtic, as the Dons looked to get back on track after the international break. Fit again Ryan Hedges and Funso Ojo were back in the starting XI alongside Declan Gallagher. Missing out were Matty Longstaff, the injured Ross McCrorie and Austin Samuels, who was on the bench. Also among the subs were Tom Ritchie, in for the ill Joe Lewis, Teddy Jenks, back after suspension and fit again Marley Watkins.
Bottom of the table Dundee also made three changes after their 3-1 defeat at St Johnstone. Jason Cummings dropped to the bench with Paul McGowan and Liam Fontaine absent from the matchday squad, replaced by Leigh Griffiths, Charlie Adam and Luke McCowan.
The hosts started well and Gary Woods had to be alert to save at full stretch in the first minute from McCowan after Dundee took a corner quickly. It was part of a good opening ten minutes for the home side, whereupon the Dons responded with Jack MacKenzie and Jonny Hayes exchanging passes before the youngster dug out a shot that Legzdins handled comfortably.
Aberdeen won a first corner down the left on 17 minutes but from Calvin Ramsay's low delivery, Hedges ballooned the ball over the bar. McMullan went on a dangerous run on 23 minutes, sprinting 60 yards upfield before pulling a shot wide. With the rain hosing down, the tension that both sides were feeling was palpable, the game desperately needing a goal.
A superb diagonal ball from Adam had McCowan away on 27 minutes but his effort was well wide of goal from just outside the area. Lewis Ferguson had a pop from similar distance on 31 minutes, Adam getting a deflection in that sent it behind for a corner. From that, Ramsay produced a good near post delivery, Christian Ramirez flinging himself full length to head at goal, the ball headed off the line by Griffiths. A short corner followed, the ball eventually worked out to Hayes who thundered a shot just wide from distance. Adam tried one from the same range on 35 minutes, shooting over the bar. The Dundee skipper collected the game's first caution three minutes later after barging into Hedges.
Gallagher had to be sharp to block a shot from Griffiths on 42 minutes and from the resulting corner, Sweeney's weak header bounced tamely wide. Byrne then joined Adam in the book for clattering Hayes.
Four minutes into the second half, the Dons were hit with a real sucker punch, Dundee breaking quickly, an accurate long ball forward from McMullan finding Griffiths, looking suspiciously offside, in behind in the inside-right channel. Advancing on goal, he arrowed a low shot past Woods to give the hosts the lead.
Aberdeen responded quickly, Ferguson pouncing on a poor clearance to fire off a shot from distance on 55 minutes, Legzdins tipping it behind. The game's first change came with Griffiths limping off two minutes later to be replaced by Sheridan.
Disaster for the Dons on 62 minutes as sharp passing around the top of the box from Dundee ended with McCowan getting space to bend a left foot shot around Woods and into the bottom corner from 18 yards.
Aberdeen made two changes to try to rescue the game on 65 minutes, Watkins and Niall McGinn replacing Hayes and Ojo. It brought instant dividends, McGinn finding MacKenzie to thread the ball through the penalty area, Ramirez coming in at the back post to score with a neat finish from a tight angle to get the Dons back into the game.
Momentum was with Aberdeen now and Hedges crashed a shot at goal from 20 yards, Legzdins doing well to claw it away. Mullen then came on for McCowan as Aberdeen waited to take the corner, Legzdins clutching the ball comfortably when it did come in. Hedges was immediately in the book for a late tackle, Mullen getting away with a similar foul a minute later.
There was a nasty clash of heads in the Dundee box on 78 minutes, Ashcroft coming off worst, drawing blood from a head wound that needed bandaging up by the medics. Byrne was next in the wars after a collision with Gallagher on halfway after 86 minutes that needed lengthy treatment before he was stretchered off to be replaced by Anderson. While that was going on Aberdeen goalkeeping coach Gordon Marshall was shown a red card.
With nine minutes of added time to be played after the break for Byrne's injury, two of it taken in getting him off the pitch, the Dons needed to try and recapture the momentum they had after the goal. Things were slowed down again when Dundee boss James McPake was red carded and Gallagher booked after an altercation off the pitch that involved MacKenzie being shoved to the floor by another member of the Dundee coaching staff as they tried to prevent him taking a quick throw-in. Sheridan was booked for doing the same a couple of minutes later.
Jay Emmanuel-Thomas joined the fray in the sixth minute of added time in place of Ferguson. Aberdeen kept pushing for that equaliser but a 20 yarder from Scott Brown was easy meat for Legzdins.
The game continued to boil over as Watkins surged down the right and was brought down by Mullen, both cautioned by the referee. Ten minutes into added time, a corner on the left, a last chance, but Ramsay's ball in was headed clear by the bandaged head of Ashcroft. The Dons were beaten.