Motherwell beat local rivals Hamilton Accies 1-0 at the SuperSeal Stadium on Saturday to move out of the relegation zone.
Louis Moult scored the only goal midway through the second half of the Lanarkshire derby as the home side dropped into the play-off place.
Kilmarnock are safe after a 2-1 home victory over bottom club Inverness CT with goals from Sean Longstaff and Jordan Jones before Alex Fisher pulled one back.
It was 1-1 between Dundee and Ross County at Dens Park, which means the Staggies can now look forward to another season in the top flight. They took an early lead through Liam Boyce but Darren O'Dea equalised from the penalty spot.
St Johnstone sealed fourth spot and a Europa League place with a 1-0 win over Partick Thistle at McDiarmid Park. Danny Swanson got the only goal for Saints with a first-half penalty.
Joe Garner and Barrie McKay got the goals as Rangers beat 10-man Hearts 2-1 at Ibrox. Prince Buaben was sent off before half-time for the visitors, who were briefly level through Esmael Goncalves.