IT seems reasonable to assume that Jim McIntyre, the Ross County manager, spent a largely sleepless night tossing and turning as he replayed the events of yesterday afternoon at the Global Energy Stadium over and over in his mind.

McIntyre and his assistant, Billy Dodds have done a quite remarkable job transforming the Dingwall club's fortunes.

It is doubtful that even County's most loyal fan would have risked a 10 pence piece on the team surviving in the wake of a four-goal defeat by Aberdeen at Pittodrie at the start of February.

But that dismal performance turned out to be a watershed. Since then County have won eight, drawn two and lost two of their subsequent 12 fixtures. Regrettably, one of those defeats occurred yesterday when County were on the cusp of securing their Premiership future.

McIntyre and his players will be haunted by the spectre of so many missed opportunities when they had it within their grasp to ensure that they will not be caught up in the play-offs.

Liam Boyce was guilty of missing three excellent chances while Craig Curran, Michael Gardyne, Martin Woods and Jackson Irvine might easily have put their names on the scoresheet.

But their failure to do so has thrown the race to avoid finishing 11th back into the melting pot with two matches remaining.

What had been a frustrating afternoon for County became almost unbearable in the closing moments at the Global Energy Stadium less than 24 hours after St Mirren had been officially relegated, by dint of Motherwell's home win over Kilmarnock.

There were just seconds remaining when substitute Lewis Morgan was brought down by Mark Brown, forcing referee Steven McLean to immediately point to the penalty spot before red carding the County goalkeeper.

As McIntyre had used his permitted quota of three substitutes they were unable to bring on Antonio Reguero and Darvydas Sernas took over between the posts. But the Lithuanian was unable to prevent Steven Thompson from scoring.

Now County must do it all again at home on Saturday against Hamilton. DUring the wait until then they will reflect on the brutal reality that their rivals managed just two shots on target in the entire 90 minutes, both resulting in goals.

Just what ramifications a second victory in three matches for St Mirren at the tail end of a season of almost unrelenting misery will have for County remains to be seen after Stephen Mallan had cancelled out Martin Woods' opener.

McIntyre reflected. "The chances we created were clear-cut and we should have been out of sight. But if you don't do that then the opposition has always got a chance of getting back into the game.

"I'm not displeased at how we played at all. I thought we played some great stuff into great areas, but we were wasteful in front of goal.

"The thing we were looking for was not to lose the match and I thought we could have managed the game better. We were chasing a win and at times it left us exposed on the counter-attack.

"It also wasn't on for Mark Brown to come. He had to stay in his goal although it was good play from St Mirren's point of view.

"But now it's time to concentrate on Hamilton. We would have liked to have got our cushion back to six points, but we didn't do that and so it's about how we respond."

With Gardyne supplying width on the right side and Curran and Boyce forming a spearhead, St Mirren were forced on to the back foot.

If there was a criticism of County it was that they lacked composure at times. There was a need for someone to slow the home side's frantic pace and introduce a more measured approach.

However, there was a sense that it was only a matter of time before County turned their sustained pressure into a goal, and Sean Kelly's clumsy challenge on Boyce resulted in St Mirren conceding a penalty kick with half-an-hour played.

Woods was spot on. Although Mark Ridgers guessed correctly when he threw himself to his left, he had no chance with the perfectly struck kick into the top-right corner.

Curran and Boyce should, have ended it as a contest, but the former hesitated and Jason Naismith had time to whip the ball clear in the 33rd minute before the latter shot over the bar from just six yards out, prior to also heading another chance over.

The pair's profligacy was punished when Mallan's snap shot from 25 yards struck Scott Boyd and spun over Brown into the top right corner six minutes from the interval.

And try as they might as they launched wave after wave of attacks, County simply could not hit the target before losing out in the most dramatic of finishes.

The St Mirren manager Gary Teale added: "We rode our luck at times, but I felt everybody throughout the team did well and my goalkeeper and my defence were excellent."