Ross County slipped back into the Premiership's relegation play-off place after losing out 3–1 to St Mirren in Dingwall.
The Staggies had taken a first-half lead through Jordan White’s 18th-minute strike, only to concede five minutes after the restart when former County attacker Lee Erwin found the net.
Ilkay Durmus then scored the winner in the 71st minute, and Jamie McGrath converted a penalty in injury time to send the Buddies back up to seventh in the table.
- How the teams lined up | Match stats
- Scottish Premiership latest news | Get Sky Sports
- Scottish Premiership fixtures | results | table
St Mirren started the match looking very solid, making it difficult for their hosts to move up the park for any sustained period of time, but they did not threaten Ross Laidlaw much themselves.
A quick free-kick routine caught the Buddies out at the back though, and despite half-clearing they could not regroup quickly enough to stop Jordan Tillson sending the ball back in.
His header found White, who managed to guide it past Jak Alnwick and into the top corner.
Although Kristian Dennis’ header had Laidlaw scrambling across to his right, from there County went on the front foot with Tillson forcing a spectacular save out of Alnwick just on the stroke of half time.
St Mirren returned for the second half with a renewed intensity though and it did not take long for them to equalise.
Just five minutes into the half, Richard Tait broke free down the left flank and sent the ball into the middle where former County man Erwin had found space between the defenders to head into the net.
Laidlaw had to make a reaction stop with his feet on the hour to stop Conor McCarthy putting the visitors ahead.
They would eventually earn the lead in the 71st minute though, springing forward on the counter-attack with clinical precision.
Collin Quaner managed to get the better of Keith Watson in a race for the ball and he patiently waited for a team-mate to join him in the final third before picking out Durmus with a cutback – with the German finding the net with a first-time finish.
A similar move would see Cameron MacPherson hit the side netting and Kyle McAllister also hit the woodwork in the dying minutes.
They would get a third before all was said and done though, with Jamie McGrath scoring from 12 yards after Leo Hjelde was judged to have handballed inside his own box.
What the managers said...
Ross County manager John Hughes: "In the second half, it's the same old story - we can't keep that back door shut.
"For me, it's not great goals, they are self-inflicted. Our first line of defence should be from the front. The fundamental stuff we have to be better at, but we've been saying that all season.
"You can coach it all you like, they need to do it on the pitch."
St Mirren boss Jim Goodwin: "After missing out on the top six, we reassessed the situation and we set new targets.
"Seventh is where we want to go, but it will be difficult because we've got good teams like Dundee United and Motherwell in there competing with us.
"That's where we want to be, and we've never finished in seventh since the Premiership was formed so it would be a nice way to cap off the season.
"If you'd offered me a point before tonight, considering the injury list we had, I might have taken it, but the boys were brilliant."
St Mirren are in Scottish Cup quarter-final action on Monday when they travel to Kilmarnock; kick-off 7.45pm.
Meanwhile, Ross County are not back in action until May 1 when they travel to Dundee United in the Scottish Premiership; kick-off 3pm.