Wins for Partick Thistle and Kilmarnock ensured that either Killie or Hibernian are in fear of the relegation play-offs on the final day.
Partick came back from a goal down twice to romp to a 4-2 win at already-relegated Hearts. Goals from Lyle Taylor, Gary Fraser, Lee Mair and Kallum Higginbotham cancelled out home strikes from Callum Paterson and Danny Wilson and meant Partick lifted themselves three places to seventh.
Alan Archibald's men are now top of the bottom section of the Scottish Premiership. Just three points separate them from Hibernian, who currently reside in the relegation play-off spot, but they are no longer in danger with Kilmarnock travelling to Easter Road in the final game.
Kilmarnock were the other big winners on Wednesday, with a 1-0 victory over St Mirren settled by a 21st-minute strike from Kris Boyd, his 21st goal of the season. The win halted a run of three defeats since the division was split and manager Allan Johnston will be hoping his team's form has turned just in time, with the crunch encounter with Hibernian to come.
The Rugby Park men will have to go into that Hibernian clash without midfielder Barry Nicholson, though, who came on as substitute in the 81st minute, but was booked in the 85th and 87th to receive his marching orders.
A draw would leave Kilmarnock safe and condemn Hibernian to the relegation play-offs, while a Hibs win would leave Killie at risk of the drop.
At the top of the table, Neil Lennon's Celtic let a 3-1 lead slip to draw 3-3 in a remarkable game at McDiarmid Park.
St Johnstone were ahead at half-time through an early Tim Clancy strike, but quickfire goals from Kris Commons from the penalty spot, Finnish striker Teemu Pukki and Dutch defender Virgil van Dijk gave the visitors a seemingly comfortable advantage.
But Tommy Wright's men, who have one eye on the upcoming Scottish Cup final with Dundee United, replied to stun the champions with late strikes from Scott Brown and Michael O'Halloran.
In a game with little at stake, however, Celtic's three strikes do put them on 99 league goals for the season.
Wednesday's final game saw Motherwell beat Inverness Caledonian Thistle 2-1 with first-half goals from a John Sutton penalty and a Gary Warren own goal.
Inverness replied with a second-half Graeme Shinnie strike. Motherwell were already safe in third place as the second UEFA Europa League qualifier after Dundee United lost 3-1 at home to Aberdeen on Tuesday.