A breathtaking injury-time equaliser from Danny Mullen left St Mirren within two points of safety in the Ladbrokes Premiership.
Substitute Christopher Kane looked to have sealed all three points for the visitors until Mullen stepped up to slam home a truly unstoppable volley with the game entering added time.
With late goals affecting all the relegation-threatened sides, Mullen moved onto Jason Kerr's clearing header on the edge of the area and arrowed a thunderous volley beyond Zander Clark into the top corner.
It was a subdued start to the game and despite having relatively little to play for it was St Johnstone who began to grow into the ascendancy as they dominated possession.
St Mirren enjoyed an important win against Livingston last weekend that eased them away from the foot of the table and they created the first real chance of the game in the 19th minute.
Captain Stephen McGinn easily dispossessed Michael O'Halloran on the edge of the area before firing a powerful left-footed drive that Clark excellently palmed over the bar.
St Johnstone raced up the pitch and Murray Davidson squandered a golden opportunity to break the deadlock in the 23rd minute.
The gangly midfielder bulldozed his way through a number of half-hearted challenges but he toe-poked wide with Vaclav Hladky closing the angle.
Unsurprisingly it was a scrappy affair as Steven McLean was continuously forced to halt proceedings as both sides committed numerous fouls.
After Davidson was cautioned for persistent fouling, Anders Dreyer came agonisingly close to finding the opener.
The Denmark Under-21 international curled a glorious cross from the right that avoided any touch before bouncing off the post to safety.
With chances at a premium, set-pieces were the best chance of a goal and Paul McGinn almost obliged when he headed a corner narrowly wide as half-time approached.
Both sides made a change at the interval with David Wotherspoon entering the fray for the visitors and Kyle Magennis for the hosts as they abandoned their defensive back five formation.
The changes momentarily galvanised the St Mirren as they began to play on the front foot but they failed to create a meaningful chance as crosses were fired aimlessly into the box.
Tommy Wright was incensed with the lack of protection for young striker Callum Hendry and eventually replaced him with Kane.
The change paid dividends almost immediately as the the 24-year old striker fired the visitors ahead in the 79th minute. Liam Craig switched the play to Richard Foster who skipped past a challenge before sliding in Kane who confidently finished low across Hladky into the bottom corner.
However there was still time for the Buddies to change the course of the game, with Mullen stunning Saints in stoppage time.