Hibernian moved up to second in the Scottish Championship table with a convincing 4-1 victory over bottom club Alloa as Rangers could only draw 2-2 with Falkirk.
Martin Boyle and Liam Craig gave Hibernian a two-goal lead at half time, with Jason Cummings adding a third on the hour mark. Iain Flannigan pulled a goal back, but Dominique Malonga completed the scoring for Hibs in the 71st minute.
Rangers dominated the first half at Ibrox but failed to score. John Baird punished them after the restart before Tom Taiwo doubled Falkirk's lead.
Newcastle United loanee Haris Vuckic pulled a goal back with seven minutes remaining and Nicky Law completed the Rangers comeback in stoppage time.
Hearts left it late to beat Cowdenbeath, who led through Colin Marshall before Callum Paterson equalised after half an hour.
Cowdenbeath defended stoutly for the rest of the match, but Brad McKay converted a stoppage-time penalty to give the champions victory at Central Park.
Queen of the South guaranteed their playoff place with a 2-1 victory over Dumbarton. Kevin Holt and Stephen McKenna gave Queens a two-goal lead before Donald McCallum made it a nervy finish.
Finally, Livingston earned an impressive 4-0 victory away to Raith Rovers. They travelled to Kirkcaldy knowing that a loss would consign them to League One football next season, but Callum Fordyce got them off to a perfect start in the 18th minute.
Goals from Craig Sives, Daniel Mullen and an own goal from former Livi captain Craig Barr secured the points. Livingston, Cowdenbeath and Alloa will all be fighting for survival next weekend, with just one of the teams able to avoid automatic relegation or a relegation playoff.
Results in full: Cowdenbeath 1-2 Hearts, Hibernian 4-1 Alloa, Queen of the South 2-1 Dumbarton, Raith Rovers 0-4 Livingston, Rangers 2-2 Falkirk