Relegated Dundee said farewell to the cinch Premiership with a 2-1 defeat at Livingston.
With the Dens Park club announcing on Saturday that manager Mark McGhee would not be in charge next season, it was a disappointing conclusion to a dismal campaign.
The Dark Blues looked to be going out on a high when Josh Mulligan scored for the second game in a row.
But Andrew Shinnie equalised 12 minutes from time for Livingston, who had already secured seventh place.
Just six minutes later they completed a stirring comeback as Alan Forrest marked what is likely to be his final game for the Lions with the winner.
Dundee began the brighter and twice came close to a breakthrough in the opening exchanges.
With just three minutes gone, Paul McMullan’s shot was tipped around a post by home goalkeeper Max Stryjek.
Cammy Kerr nodded Niall McGinn’s corner into a crowded six-yard box and Max Anderson hit the outside of the left-hand upright with a close-range volley.
The visitors enjoyed the upper hand as they began brightly in their Premiership goodbye.
Another corner from McGinn caused Livi problems but Ryan Sweeney’s header looped just too high and landed on the roof of the net.
The home side finally sparked into life in the 19th minute as they threatened for the first time.
Craig Sibbald found some space on the edge of the box but his right-foot effort went just wide.
The Lions appealed for a penalty midway through the half as Cristian Montano scampered onto an Odin Bailey through ball and went down in the box under a challenge from Jordan Marshall.
But, instead of pointing to the spot, referee John Beaton booked the winger for simulation.
Back came Dundee again but they found Stryjek in inspired form in the Livingston goal.
Zak Rudden picked out McMullan with a cross-field pass on the break but the winger’s shot was clawed away from the top corner by the home keeper.
Nine minutes from the break, Livingston carved out the best move of the half. Adam Lewis played a give-and-go with Montano after being found on the left wing by a diagonal pass.
But the on-loan Liverpool youngster’s drive was touched over the crossbar by Harry Sharp.
Sharp again denied Livingston when he repelled a Jack Fitzwater header eight minutes into the second half, before the breakthrough finally arrived in the 59th minute.
Marshall clipped in a brilliant cross from the left and Mulligan timed his arrival at the back post to perfection to power in a header.
Livi upped the tempo in search of a leveller and got it 12 minutes from time.
Bailey had curled a shot wide and substitute Joel Nouble was then inches away from tapping in the winger’s cross before the equaliser in the 78th minute.
Substitute Nicky Devlin’s header from a Lewis corner was cleared off the line, but Forrest kept the ball alive and Shinnie steered in the winger’s low pass from close range.
Having made all their subs, Livi were then reduced to 10 men as Morgan Boyes was helped from the field. But they still managed to dig out a winner six minutes from time.
Bailey ran at the Dundee defence on the right before finding Forrest on the edge of the box and the winger curled a brilliant left-foot shot beyond Sharp.