Adama Sidibeh’s late header was enough to send the relegation play-off place battle to the final day as St Johnstone claimed a dramatic draw with Ross County at McDiarmid Park.
Yan Dhanda’s first-half solo strike looked set to secure County’s place in the Scottish Premiership and condemn the hosts to second bottom until Sidibeh planted an inch-perfect header past Ross Laidlaw in the 91st minute.
St Johnstone remain two points behind County, who welcome Aberdeen on Sunday while the Perth side visit Motherwell.
Interim County manager Don Cowie was "proud" of his side's display, adding: "We've not picked up enough points away from home but when we put in performances like we did tonight, you deserve to get something out of the game.
"I've got so much belief in this group. They've done so many good things over the last six-to-eight weeks and now it's still in our hands and it's about finishing the job."
Despite the 2-1 loss to Livingston at the weekend, Saints manager Craig Levein was delighted with his side’s performance and kept the same starting 11.
The problem with playing well but still losing is that it doesn’t boost morale, and St Johnstone’s attack looked devoid of any conviction.
They created plenty of chances in the first half, none better than Stevie May’s effort. Following a wild swing from Jack Baldwin, May was able to get in behind but when one-on-one, he hit a tame effort straight at Ross Laidlaw.
Daniel Phillips also had a chance from eight yards out when Nicky Clark laid the ball to him, but the midfielder sliced his effort high and wide.
County were more clinical. Dhanda bounced a pass off Jordan White and breezed through a chasm in the Saints defence before leathering the ball past Dimitar Mitov.
That was the only shot Mitov let by him, repelling George Harmon moments later when the left-back hit a piledriver from 20 yards. He stopped Simon Murray’s follow-up too, but the Country striker was offside.
The second half was marginally better for St Johnstone. There was a frantic penalty appeal when David Keltjens went down in the box, but Nick Walsh was unmoved.
Largely though, it looked like they were sliding towards the play-off place with a whimper, until Sidibeh's moment of brilliance.
Graham Carey whipped a cross in for the smallest man on the pitch, who leapt between defenders to guide his header in at the back post and perhaps rescue St Johnstone's season.
Player of the Match - Simon Murray (Ross County)
Saints rescued at the death after County dominance - analysis
There was a decent crowd to cheer St Johnstone, but their faces grew longer and longer as the night went on.
There was not going to be a better chance than May’s in the first half and when he dribbled his effort at Laidlaw, it seemed apparent that the Saints wouldn’t trouble the County goal.
But Sidibeh has been one of the league's feelgood stories and, if St Johnstone stay up, his will be a tale told time and again in Perth.
While County’s efforts may have been devoid of much art, they had plenty of soul. They looked certain of the plan, showed the steel required, and seemed pretty comfortable throughout.
One lapse of concentration has cost them, though, and a visit from on-form Aberdeen will certainly worry them. They'll be hoping former County man Blair Spittal does them a favour on Sunday.
What they said
St Johnstone manager Craig Levein: "We were a bit inconsistent, but again the team very rarely let me down in regards to effort and willingness to keep going until the last whistle and they've done that again.
"The only things that is slightly disappointing about this evening is that it's slightly out of our hands. I'd rather have the opportunity to beat Motherwell and that guarantee us something."
Ross County interim manager Don Cowie: "The game comes Sunday and that's really quick. We've got to turn our attention to Aberdeen straight away.
"The performance was really good, they've got real belief. They'll be disappointed and rightly so on the back of conceding so late. That's football, that happens, it's about bouncing back."
What's next?
St Johnstone host Motherwell on Sunday while Ross County welcome Aberdeen (both 15:00 BST).