Substitute Melvin de Leeuw's strike gave Ross County a 3-2 win over Partick Thistle in a thrilling Scottish Premiership finale at Firhill.
Jordan Slew shot the visitors into the lead in the 22nd minute with his first goal since joining on loan from Blackburn in January and Yoann Arquin added a second three minutes after the interval when he headed in a Graham Carey free-kick.
Jags' striker Lyle Taylor reduced the deficit two minutes later and substitute George Moncur, on for Chris Erskine, levelled in the 73rd minute with a drive for his first Thistle goal since arriving on loan from West Ham in the New Year
But de Leeuw, on for Arquin, restored County's lead in the 77th minute with a deflected drive with the visitors holding on for three points which left them in seventh place in the table, with the Jags dropping down to 10th.
Both clubs had ensured their Scottish Premiership safety beforehand but with more cash earned in prize money the further up the table a club finished, this was no meaningless fixture.
There was a minute's applause "for all those associated with Partick Thistle and Scottish football that have sadly passed away this season" before the game but amid a more relaxed atmosphere than normal an open game unfolded.
In the 16th minute Slew did well to work a yard of space for himself in the Jags box but he drew his shot wide of the far post.
However, the big striker was more decisive when he was presented with another opportunity four minutes later from an Arquin pass, easing past Thistle defender Conrad Balatoni before shooting low past Scott Fox, who had returned to take over from Paul Gallacher, from the middle of the box.
The mood of the Thistle players and fans changed somewhat after that and some desperation was to be found in the Maryhill air.
Two minutes from the break County midfielder Alex Cooper tested Fox with a drive from distance which the Partick keeper palmed up into the air with Slew heading off the post as both men collided, the ball cleared to safety.
While Slew had his wrist bandaged, the Jags keeper was treated for longer and had to be replaced by Gallacher.
Gabriel Piccolo was replaced by midfielder Steven Lawless for the start of the second half as Alan Archibald tinkered with his side's formation.
But initially it only appeared to confuse the Jags as Carey's free-kick to the back post saw Arquin get away from stopper Lee Mair and bullet his header past the helpless Gallacher.
As County let their guard slip, Christie Elliott's cross from the right was met by Taylor who headed high past Mark Brown from eight yards with impressive power, to change the dynamic.
For the first time in the game Thistle had the visitors pinned back in their own half.
In the 66th minute Brown made a fine save from Lawless's 20-yard drive, after he had been set up Kallum Higginbotham, the home side unable to capitalise on the corner.
Thistle were not to be denied though and Taylor took a Higginbotham pass and set up Moncur with a clever back heel and he drilled his shot past Brown and into the far corner of the net.
But there was more drama to come.
As County threatened for almost the first time in the second half, Dutchman de Leeuw turned inside Taylor and his left-footed drive from just inside the box took a nick off James Craigen before beating Gallacher.
Despite a late flurry from the Jags, it was enough to give the Highlanders all three points.