St Mirren were cruelly defeated by Aberdeen as Lewis Ferguson's injury time effort sealed a 2-1 win for the Dons.
Ethan Erhahon's first league goal had given Saints the lead before Marley Watkins levelled for the home side. With time ebbing away Ferguson netted in injury time from just outside the box to win it for Aberdeen.
Marley Watkins raced through and managed to shrug off Conor McCarthy. He found himself at the byline but his attempted cut-back was blocked by Jak Alnwick before McCarthy got clear.
Alnwick was called into action again four minutes later when he made a good save to deny Scott Wright from the edge of the area. Niall McGinn was on to the follow-up but McCarthy put his body on the line to block what looked likely to be the opener.
Alnwick was busy again as the Saints goalkeeper got down well to push away Lewis Ferguson's powerful 20 yard drive on 18 minutes.
Saints were well in the match and went close twice in the space of a minute on the half-hour mark. Lee Erwin sent Jon Obika on his way with a flick on from Alnwick's goal kick. The forward held of the Dons defence to go through but Aberdeen's Tommie Hoban did well to block Obika's effort and send it wide. Then, moments later, a Cammy MacPherson strike was deflected just over Joe Lewis' cross bar.
Erwin was causing Aberdeen problems and went close himself on 37 minutes when he was found in space at the back post. The striker met the ball but his effort, from a tight angle, was held by Lewis.
Jim Goodwin would have been asking for more of the same at the break and Saints' positive performance was met by a goal nine minutes into the second-half. St Mirren Youth Academy graduate Ethan Erhahon scored his first league goal for Saints with an unbelievable strike from distance. The 19 year-old met MacPherson's touch and rattled it into the top corner from 22 yards with Lewis rooted to the spot.
It was no less than Saints deserved with Aberdeen boss Derek McInnes making changes by bringing on Connor McLennan and Ryan Edmondson for Scott Wright and Niall McGinn. The changes seemed to spark the Dons into life and they levelled with less than 20 minutes to go when Marley Watkins drove home from just inside the box after a near bit of play from the home side.
Saints looked like they were about to earn a well-deserved point but Ferguson's injury time effort cruelly snuck beyond Alnwick to give Aberdeen all three points.
Full-Time: Aberdeen 2-1 St Mirren
St Mirren: Alnwick, Shaughnessy (c), McCarthy, Sheron, Obika, MacPherson, McGrath, Morias, Fraser, Erwin, Erhahon
Subs Not Used: Lyness, Jamieson, Durmus, McAllister
Aberdeen: Lewis, Hoban, Considine, McGinn (Edmondson 63), Hedges (McGeouch 90), Taylor (Anderson 87), Hayes, Ferguson, Wright (McLennan 63), McCrorie, Watkins
Subs Not Used: Cerny, Logan, Ojo, McGeouch, Hernandez, MacKenzie
Referee: Gavin Duncan
Assistant Referee: Graeme Leslie
Assistant Referee: Graham Chambers
Fourth Official: Alan Muir