Substitute Craig Thomson was the hero for St Johnstone as they took a giant leap towards the Europa League with a wonderful win at Pittodrie.
Thomson replaced David Wotherspoon with 72 minutes of the match against Aberdeen gone and then proceeded to take the game by storm.
Firstly, it was his strike that led to the first goal from Danny Swanson on 80 minutes.
Secondly, Thomson did it all himself as he raced in from the right before smashing a low drive past Dons goalie Joe Lewis to wrap up the points.
The excellent result moved fourth-placed Saints six points clear of Euro rivals Hearts, who drew at home to Partick Thistle.
The McDiarmid men will also fancy themselves to get closer to Rangers in third and now sit just six points behind them with four matches to play.
As the teams trotted out, there was a major milestone reached by Saints keeper Alan Mannus, who made his 200th appearance for the McDiarmid club.
The Perth men brought back Steven Anderson, Murray Davidson, Graham Cummins, Swanson and new contract man Chris Millar.
Out of the side went Tam Scobbie, Paul Paton, Michael Coulson, Blair Alston and the suspended Steven MacLean.
The Dons made just one change from their Scottish Cup semi-final success over Hibs, with Niall McGinn in for Mark Reynolds.
Mannus was called into action on seven minutes when he had to dive to his left after Aberdeen’s Adam Rooney helped on a shot from Graeme Shinnie.
The visitors were being pinned back by the Dons – apart from a couple of freekicks into the home box – but on 22 minutes Swanson found himself with a clear path to goal, only to take too long and allow Jonny Hayes to nip in and scupper the chance.
There was a blow for St Johnstone on 35 minutes when Millar had to go off injured, with Paton taking his place in midfield.
Decent opportunities were few and far between in the first half but, just a minute before the break, Kenny McLean looked certain to put the Dons ahead but could only send his diving header past the post after being found by a great ball from Hayes.
The second period was just a couple of minutes old when McLean fired just wide for the home side then the same player blasted over from 25 yards on 55 minutes.
Saints were still right in the running and, with an hour gone, they had the home fans worried when Liam Craig sent over a freekick and Anderson headed just wide of the far post.
Then, just two minutes later, Swanson’s 25-yard strike whizzed past goalie Joe Lewis’s right-hand post.
The Dons made a double witch on 65 minutes, bringing on Peter Pawlet and Jayden Stockley for Christie and Rooney.
Saints then brought Thomson for Wotherspoon and what a decision that would turn out to be.
Indeed, with 80 minutes on the clock St Johnstone took a dramatic lead, with sub Thomson playing a leading role.
He created a chance for the visitors but his shot from a tight angle was saved by Lewis
The ball was still loose, though, and Ryan Jack played the ball and Lewis picked it up.
Referee Alan Muir pointed for a freekick for picking up a passback, much to the horror of the Aberdeen players.
Craig then nonchalantly laid the ball into the path of Swanson, who fired home to make it 1-0.
If that left Pittodrie stunned then the Dons supporters were in shock three minutes later when the Perth men made it 2-0.
Thomson was a hero once again, this time scoring himself with a low drive after Saints had caught out the hosts with a terrific break upfield through Swanson.
Despite some pressure form the home team, the visitors saw out the game to give their European hopes a massive boost.
Attendance: 10,606.
Aberdeen: Lewis, Logan, Shinnie, Considine, Taylor, McLean, Christie (Pawlett 65), Rooney (Stockley 65), McGinn, Hayes (Wright 88), Jack. Subs not used: Alexander, Reynolds, O’Connor, Storey.
St Johnstone: Mannus, Anderson, Millar (Paton 35), Davidson, Wotherspoon (Thomson 72), Swanson (Alston 87), Shaughnessy, Foster, Easton, Craig, Cummins. Subs not used: Clark, Scobbie, Smith, Coulson, Paton.
Referee: Alan Muir.