Raith Rovers' promotion hopes ended as Colin McMenamin's stoppage-time strike gave Queen of the South a win at Stark's Park.
McMenamin scored three minutes into added time, meeting Stephen Black's cross to convert from close range.
In a disappointing opening half, Rovers' best effort came after 19 minutes, John Baird's effort from inside the box hitting the crossbar.
McMenamin then fired over from 18 yards four minutes before half-time.
Baird and Craig Wilson both fired wide from the edge of the area in the second period for the Kirkcaldy side.
Robert Harris' 25-yard free-kick wide was the best Queen of the South could muster after the break until McMenamin snatched all three points.
Even a win would not have kept Rovers' title hopes alive as Dunfermline's victory at Morton ensured they are crowned champions with one game remaining.
Raith: McGurn, Murray, Campbell, Hill, Ellis, Williamson (Craig Wilson 66), Kevin McBride, Davidson, Scott McBride (Ferry 82), Baird, Weir (Tade 71). Subs Not Used: McNeil, Simmons.
Booked: Weir, Murray.
Queen of the South: McKenzie, Craig Reid, Lilley, Harris, Quinn, Johnston, McKenna, McGowan (Smylie 73), McShane (Degnan 79), McMenamin, Weatherston (Black 87). Subs Not Used: Hutton, Carmichael.
Booked: McGowan, McMenamin, Black.
Goals: McMenamin 90.
Ref: John McKendrick