Ryan Astley scored a last-minute winner as Dundee defeated Aberdeen 3-2 at Dens Park to finish in eighth place in the William Hill Premiership.
Kilmarnock signed off in style, seeing off relegated Livingston 4-1 in West Lothian helped by a double from Joe Hugill.
St Mirren, who will face Partick Thistle in the play-offs, drew 1-1 with seventh-placed Dundee United at the SMISA Stadium.