St Johnstone overcame "nervousness" and "a few dodgy moments" to stave off automatic relegation for now and narrow the gap at the bottom of the Scottish Premiership to three points with a crucial victory over Ross County.
The win delivers a lifeline as defeat for the Perth side would have ended their 16-year stay in the top flight.
Saints were pegged back after Daniel Balodis' headed opener when Alex Samuel touched home from close range to equalise, an outcome that would have left the hosts six points adrift with two games remaining.
However, after some incredible missed chances, Simo Valakari's men survived an injury-time onslaught and Ronan Hale effort that was ruled offside, to earn a vital win thanks to Elliot Watt's composed finish into the corner.
In the dying moments, County's misery was compounded when Zach Ashworth was sent off for something he said to referee John Beaton.
It is a record-equalling seventh straight defeat for second-bottom County in the top flight, a run that leaves them in deep relegation trouble with games running out.
"We could all see the nervousness and there were a few dodgy moments when we didn't do the right things. That's totally understandable - my players are human beings," said St Johnstone manager Valakari.
"But I loved that they kept trying to do the right things under pressure and in the end it all came good. We've kept the fight going."