Heart of Midlothian 2-4 Partick Thistle
Partick Thistle sealed their Premiership safety after producing a stunning second-half comeback to get the better of Hearts.
Callum Paterson opened the scoring for the hosts before Lyle Taylor squared it, but Danny Wilson nodded Hearts back in front before the break.
Gary Fraser levelled with a super strike, Lee Mair headed the Jags in front and Kallum Higginbotham won it.
The victory means Thistle cannot finish in the relegation play-off position.
And that sets up a thrilling showdown between Hibernian and Kilmarnock, who are now the only teams in danger of finishing 11th in the table, at Easter Road on Saturday.
Fresh from their 5-0 demolition job on Kilmarnock on Sunday, Hearts started brightly with the lively Sam Nicholson leading the charge.
The Jags soon found their feet, though, and Higginbotham tested Mark Rigders with a long-range effort, but the stand-in Hearts goalkeeper gathered at the second attempt.
The home side opened the scoring after 16 minutes. Paterson produced a great run in from the right, ghosted past Mair and fired in his 11th goal of the season, despite goalkeeper Paul Gallacher getting a hand to the shot.
It could have been 2-0 seconds later after a delightful move by the hosts.
Kevin McHattie picked out Dale Carrick and his through-ball was perfect for Billy King, but after going one-on-one with Gallacher, he could not keep his shot down.
It was all Hearts for a spell as the Jags struggled to contain the home attack, but the visitors squared it against the run of play just after the half hour.
Higginbotham did the set-up work with a fine pass to send Taylor in on goal and he showed great composure to finish through the legs of Ridgers from 18 yards.
The Jags almost took the lead after 37 minutes, but Taylor's glancing header drifted wide.
Within a minute, the visitors found themselves trailing again.
Hearts won a free-kick on the edge of the area and, from McHattie's delivery, the unmarked Wilson steered a header into the bottom corner.
Taylor thought he had levelled at the start of the second half with a fine volley from Higginbotham's pass, but the offside flag halted Thistle's celebrations.
Only for a few seconds, though, as Gary Fraser did make it 2-2 with a sensational strike that flashed past Ridgers and into the top corner from 25 yards.
James Craigen then passed up a great chance for Thistle after beating the offside trap and Ridgers had to be at his best to keep out a Taylor volley as Thistle piled forward in search of a third.
The goal they craved, and their second-half dominance merited, duly arrived in 68 minutes. A corner was knocked down by Aaron Taylor-Sinclair and Mair headed home.
It was 4-2 a few minutes later when Higginbotham blasted into the net after Ridgers saved Taylor's drive, securing the Jags' place in the Premiership for next season and piling the pressure on Hibs and Killie.