Mark O’Hara and Toyosi Olusanya scored in stoppage time to earn St Mirren a 2-1 home win and deny Neil Warnock his first league victory as interim Aberdeen manager.
Connor Barron’s goal after just 62 seconds looked set to earn the Dons a first league win for two months.
But substitute Olusanya won a penalty after a long VAR delay that was converted by O’Hara before just moments later the striker volleyed in what proved to be the winner to improve Saints’ top-six chances.
St Mirren were unchanged from the team that started their midweek draw away to Ross County, with Conor McMenamin fit enough for a place on the bench.
Aberdeen, in turn, made four changes after losing to St Johnstone.
In came Nicky Devlin, Junior Hoilett, Killian Phillips and Luis ‘Duk’ Lopes, with Jack Milne, Jonny Hayes, Jamie McGrath and Leighton Clarkson all dropping out.
FIFA president Gianni Infantino took a seat in the main stand after attending the IFAB AGM at Loch Lomond earlier in the day.
He was treated to a stunning goal after just 62 seconds as Aberdeen took an early lead.
Duk made a great run down the right wing before putting in a cross that was knocked out by Alex Gogic but only as far as Barron, who lashed a shot high in the net from 25 yards.
St Mirren rallied but a Greg Kiltie header from Scott Tanser’s cross was easily saved by Kelle Roos.
The home side should have drawn level when Zach Hemming’s deep free-kick was pushed on to the post by opposite number Roos after being helped on by Tanser.
The ball ran across the face of the goal but Lewis Jamieson couldn’t finish from close range. VAR checked for a penalty but it wasn’t given.
The forward tried a more spectacular attempt in Saints’ next attack only for his volley to clip the bar and go over despite his protests that Roos had saved it.
Aberdeen replied with a Barron header from a corner that went just wide before Mikael Mandron was similarly off target at the other end. Again VAR checked for a penalty for a foul on Mandron but once more it wasn’t given.
The visitors had been kept quiet for much of the first half but had a chance early in the second, Hoilett crossing for Bojan Miovski who headed over.
St Mirren had a chance to equalise but Elvis Bwomono sliced his shot wide at the back post while, in a rare Aberdeen attack, Phillips volleyed high into the stand.
Aberdeen looked like holding out for the win but Nicky Devlin tripped Olusanya and, after a three-minute delay, VAR decided it had been inside rather than outside the box.
O’Hara finished from the spot but Saints weren’t done there as McMenamin crossed from the right and Jonah Ayunga headed it back across for Olusanya to volley past Roos.