Dunfermline boosted their survival hopes with their first Scottish Premier League home win of the season.
After a first half of few chances, the bottom club took the lead when Joe Cardle fired past Jamie Langfield.
Cardle's free-kick was headed home by Andy Kirk as the Pars doubled their advantage on 68 minutes.
Aberdeen gifted Kirk his second to ensure Dunfermline claimed their first win under Jim Jefferies to move to within three points of Hibernian.
Hibs can restore a six-point lead when they visit St Mirren on Sunday, while Aberdeen slip four points behind seventh-placed Kilmarnock.
Dunfermline were awarded an early free-kick inside the Aberdeen box after Langfield was adjudged to have picked up a passback from a team-mate.
The goalkeeper was booked for dissent before Paddy Boyle touched the free-kick back to Martin Hardie, who fired across the face of goal.
Aberdeen threatened at set-pieces, with Russell Anderson heading over and Fraser Fyvie's free-kick nervously palmed out by home goalkeeper Chris Smith.
The rest of the first half featured little in the way of openings, Smith clutching the ball off a tame aerial effort by Scott Vernon just before the break.
Aberdeen began the second period comfortable in possession but fell behind on 56 minutes after failing to deal with a long ball.
Cardle got the break of the ball on the left edge of the area and placed a shot into the far corner of the net.
The Dons responded with Josh Magennis slicing a shot across the face of goal and Vernon flicking a header into the hands of Smith.
However, Dunfermline were growing in confidence and moved further ahead when Cardle's free-kick was glanced past Langfield by Kirk.
Youngsters Declan McManus and Jamie Masson were introduced for Aberdeen, but the duo had an unhappy introduction as Kirk completed the scoring in the 77th minute.
The Dons initially recovered from Langfield's poor clearance, but Fyvie's wayward passback sent Kirk through on goal and the striker found the net despite Langfield getting something on the ball.
Smith rounded off a day of 'firsts' with his maiden shut-out of the season.