Ross County broke a run of four games without a goal by scoring twice as they sent title challengers Ayr crashing to their first home defeat of the season.
On-loan Dunfermline striker Owen Coyle fired home a cross from debutant Karim Boukraa on seven minutes.
Ayr spurned a great chance to level when Steven Boyack was pulled down on 30 minutes by Nicky Walker, but the keeper redeemed himself by diving to his right to parry Boyack's weakly-hit kick.
Ayr threw everything into attack in a bid to hit back but were killed off on 48 minutes when Mark McCormick scored with a measured lob from 22 yards.
The fight went out of Ayr after that and County could have added to their lead when a Steven Ferguson drive was superbly tipped round the post by Marius Rovde.