Michael Moffat's two goals in the space of 10 second-half minutes killed off the cup dreams of Highland League side Clachnacuddin - and earned Second Division Ayr a nervy 2-1 William Hill Scottish Cup third round success.
Scott Graham had fired the Inverness-based visitors into a shock 14th minute lead, latching onto a header from Chris Ross and steering a low right-foot shot beyond keeper Alistair Brown from eight yards.
However, Ayr pulled level just five minutes after the resumption, the impressive Moffat heading in substitute Ross Robertson's cross.
Then in the 60th minute John Campbell brought down David Winters and Moffat lashed home the penalty to put the Honest Men on their way.
Moffat almost completed his hat-trick in the 65th minute when his shot from the edge of the penalty area flashed just wide.