Oisin Smyth's 90th-minute free-kick gave 10-man St Mirren a vital Scottish Premiership victory against Ross County in a wet and wild day in Dingwall.
Stephen Robinson's side went ahead in the first-half when Jack Hamilton spilled Greg Kiltie's free-kick and Alex Iacovitti stabbed home to score against the club he used to captain.
It only took 29 second-half seconds for County to find a leveller, though, with Michee Efete slotting a rebound after his own header came back to him.
The pressure was ramped up on the visitors when Scott Tanser was sent off for his second yellow, and referee Ian Snedden was busy calming both sides down as various penalty shouts were ignored.
Eamonn Brophy was barged over in the box for the hosts, as was Killian Phillips up the other end, and there were two handball shouts against Efete and Josh Reid.
However, Greg Aitken saw no reason to call Snedden across to the screen.
With a few moments left, St Mirren won a free-kick on the edge of the box and Smyth - whose set-piece prowess had been pointed out by Robinson pre-match - smashed the ball into the top corner.
St Mirren stay sixth but move five points clear of Dundee, while County remain 10th after losing their last four Premiership games.