Sean Clare’s 25-yard stoppage-time strike salvaged a point for Hearts in a 3-3 thriller in Perth and lifted them off the foot of the Premiership table.
The Tynecastle side were braced for another painful loss at a ground where they have failed to win for 10 years when the full-back pounced on a loose ball to drill home a spectacular 25-yard equaliser.
First-half strikes from strikers Liam Boyce and Steven Naismith had overturned Stevie May’s early opener but a dominant second half performance by Tommy Wright’s men was rewarded with an Ali McCann equaliser and a May spot-kick.
It then looked like the home side would hold on for victory, until Clare pounced with a superb strike to rescue a point.
Hearts manager Daniel Stendel, coming off a victory over Rangers, suffered a loss last month to Saints in his first game in charge, while predecessor Craig Levein’s managerial swansong had been at McDiarmid Park.
In an engrossing encounter, Chris Kane did the hard work for the opener to release McCann on a run into the penalty area.
May pounced on McCann’s cutback for the 17th minute opener and while the former Aberdeen attacker’s right footed connection was not the cleanest, his shot evaded keeper Joel Pereira and rolled into the far corner of the net.
The visitors drew level in the 26th minute when Toby Sibbick’s low driven cross was touched home by £150,000 recruit Boyce under pressure from defender Jamie McCart.
Within five minutes, Naismith had edged Hearts ahead, bundling home John Souttar’s overhead kick from close range after keeper Zander Clark let Andrew Irving’s probing free-kick bounce off his chest.
Kane had a glorious chance to level within minutes but keeper Pereira denied the striker at close quarters.
Saints centre-half Liam Gordon came off worse in a head clash with Boyce and had to be replaced before the break by Michael O’Halloran.
Top prospect McCann pulled Saints level seven minutes after the interval when Pereira failed to halt his deflected 16-yard shot.
Panic-stricken Hearts then survived scares when Kane won a race to nudge the ball past Pereira only for it to roll agonisingly wide, before a 20-yard Anthony Ralston strike struck the crossbar.
But May fired Saints in front again from the penalty spot in the 62nd minute, after Craig Halkett hauled back Jason Kerr jousting for Liam Craig’s free-kick at the back post.
McCann missed a late chance and Saints paid the price when Clare produced his sensational last-gasp strike.