Michael Gardyne struck a double as Ross County withstood a second-half comeback from Motherwell to edge a five-goal thriller in Dingwall.
Gardyne scored either side of Davis Keillor-Dunn's goal to put County three up at half-time at the Global Energy Stadium.
But Ryan Bowman pulled one back within three minutes of the restart and County had a nervous 11 minutes plus injury-time after Louis Moult headed home.
However, County survived some late pressure to record a 3-2 Ladbrokes Premiership victory and make it two successive home wins.
It was a second defeat in a row for the Betfred Cup finalists and County moved five points behind them in the table in eighth place.
The visitors started well and Moult had a goal disallowed for offside before Gardyne opened the scoring when he converted Andrew Davies' ball across the face of goal in the 13th minute.
Motherwell defender Peter Hartley headed against the bar but again the visitors were quickly caught with a sucker punch in the 26th minute when Keillor-Dunn was afforded time and space on the left to fire home his second goal of the season into the top corner following Gardyne's pass.
Keillor-Dunn soon missed another good opportunity but Gardyne looked to have wrapped up three points with three minutes of the half remaining when he fired home a loose ball inside the box.
Motherwell needed a goal quickly after the restart and they got it when Bowman headed home from fellow substitute Elliott Frear's cross.
County composed themselves and Ross Draper volleyed over the Motherwell bar but the hosts failed to make the most of several chances to hurt their opponents on the counter-attack and the comeback really looked on when Moult headed in Chris Cadden's cross.
Frear cut in dangerously but shot wide of the near post and Cedric Kipre had a great chance to level with a minute left but headed straight at Aaron McCarey after a long throw.
There was still room for drama in stoppage-time as Motherwell got the ball in the box but County survived a goalmouth scramble as Cadden fired over.