Spirited St Johnstone endured an anxious wait at full-time before learning that their 2-1 win away to Motherwell was enough to secure their Premiership survival for a 16th successive season.
The Perth side – who went into their final match of the campaign in 11th place – knew they needed a win to have any chance of leapfrogging Ross County and avoiding the tension of a two-legged play-off with Raith Rovers to avoid relegation.
Craig Levein’s side did their bit by taking control of proceedings with first-half goals from Nicky Clark and Adama Sidibeh, either side of a missed penalty from Motherwell forward Theo Bair.
Saints defended superbly in the second half to secure the triumph they needed – but they had a nervous few minutes on the pitch at full-time before confirmation eventually came through from Dingwall that County had failed to force a winner against 10-man Aberdeen.
Bevis Mugabi, Davor Zdravkovski and Harry Paton replaced Dan Casey, Andy Halliday and Stephen O’Donnell in the Motherwell side while Levein made one tweak to the team that started the 1-1 draw at home to County, Matt Smith replacing Stevie May.
The visitors almost grabbed a fortuitous opener in the ninth minute when Zdravkovski’s clearance bounced back off the head of striker Clark and looked goalbound until goalkeeper Liam Kelly reacted superbly to claw it out.
Saints made the breakthrough in the 18th minute after Clark got on the end of a lovely Graham Carey cross to prod beyond Kelly from just outside the six-yard box.
David Keltjens threatened a second with a powerful shot from 25 yards that was pushed out by Kelly.
Motherwell had the chance to equalise in the 31st minute when Dan Phillips was penalised for handball while trying to make a headed clearance, but goalkeeper Dimitar Mitov got down to his right to save the spot-kick from former Saints striker Bair.
The Perth men took full advantage as they went on to double their lead in first-half stoppage time, Sidibeh on hand to nod a loose ball beyond Kelly inside the six-yard box after the home defence got in a mess while trying to clear their lines.
Well boss Stuart Kettlewell made a half-time change in an attempt to spark an upturn, with Jack Vale introduced in place of Paton.
Saints emerged for the start of the second half knowing that as things stood they were safe and they seemed content to soak up pressure and try to hit on the break.
Some valiant defending inside the six-yard box from Ryan McGowan and Liam Gordon prevented Lennon Miller from pulling one back in the 58th minute and moments later Miller saw a header saved by Kelly.
Blair Spittal then curled a shot against the inside of Mitov’s post in the 63rd minute as the hosts continued to be frustrated and Saints’ resolve strengthened.
Well eventually hit back in stoppage time through Moses Ebiye but a few minutes later Saints were celebrating their great escape with their jubilant supporters.