Division One champions Ross County ended a wonderful season in style with a thrilling win at relegated Queen of the South.
Daniel Carmichael put the hosts ahead after 10 minutes when he found the back of the net with a 25-yard strike.
Stuart Kettlewell headed Michael Gardyne's cross into the bottom corner just a minute later to level.
With Allan Johnston in charge for the first time, the hosts were back in front four minutes later after Sam Parkin rose to head home Carmichael's corner.
Six minutes before half-time, Dundee United-bound Gardyne tucked away an equaliser from the edge of the penalty area.
Gavin Reilly regained the lead for the Doonhamers with a neat finish after 53 minutes before Colin McMenamin brought the Staggies back level for the third time.
Gardyne then smashed home Gary Miller's cross with 13 minutes remaining before Kurtis Byrne came off the bench to secure the victory in stoppage time.
Queen of the South: Robinson, McGuffie, Potter, Black, Holt (Smylie 82), Carmichael, McKenna, McLaughlin (McShane 85), Orsi (Alan Reid 82), Parkin, Reilly. Subs Not Used: Atkinson, Degnan.
Booked: Black, McKenna. Goals: Carmichael 10, Parkin 15, Reilly 53.
Ross County: Fraser, Miller, Boyd, Munro, Morrison, Lawson, Brittain, Kettlewell, Gardyne (Byrne 83), Vigurs (Quinn 78), McMenamin (Corcoran 85). Subs Not Used: Malin, Craig.
Booked: Gardyne. Goals: Kettlewell 11, Gardyne 39, McMenamin 57, Gardyne 77, Byrne 90.
Ref: David Somers