St Johnstone claimed the final top-six place in the Scottish Premiership after Glenn Middleton's late goal was enough to beat Ross County 1-0 at McDiarmid Park. St Mirren were on course to claim a top-half finish when they led 1-0 at Hamilton with a Jamie McGrath penalty but Kyle Munro equalised for Accies in the last minute as Saints missed out on goal difference.
Adrian Sporle got the only goal as Dundee United beat Aberdeen 1-0 at Tannadice while Livingston and Hibernian drew 1-1 at the Tony Macaroni Arena. Kilmarnock thumped Motherwell 4-1 at Rugby Park, helped by a first-minute goal from Kyle Lafferty, to move off the foot of the table.
Championship leaders Hearts are 16 points clear at the top despite being held to a 0-0 draw by Arbroath at Gayfield. Inverness CT boosted their play-off hopes with a 1-0 win at Dunfermline Athletic and Morton earned an important 2-1 home victory over Queen of the South. Ayr United and Raith Rovers drew 1-1 at Somerset Park.
Falkirk moved four points clear in League 1 with a 2-0 home win over Montrose while second-placed Cove Rangers drew 1-1 at Partick Thistle. Forfar Athletic are off the bottom of the table after a 1-0 win away to Dumbarton and Clyde drop to the foot after going down 3-1 to East Fife at Broadwood. Peterhead defeated Airdrieonians 1-0 at Balmoor.
Queen's Park remain five points clear in League 2 after a 3-0 win over Stranraer at Hampden while Stirling Albion are up to second spot thanks to a 1-0 home victory against bottom club Brechin City. Edinburgh City are closing in on the play-off places after winning 2-1 at Elgin City and Stenhousemuir beat Albion Rovers 2-0 at Ochilview. Annan Athletic and Cowdenbeath drew 0-0 at Galabank.