Hamilton Accies slipped to their seventh successive defeat in the Scottish Championship - as one of their former players heaped more misery on John Rankin's rock-bottom side.
Josh Mullin, who spent last season on loan at Hamilton from Livingston, netted a deflected free-kick after 31 minutes to claim all three points for Ayr United, and keep Accies six points adrift of nearest rivals Arbroath at the foot of the table.
Accies were boosted by the signing of two new defenders on loan just before kick-off, with Tom Sparrow coming in from Stoke City and Dylan McGowan arriving from Kilmarnock, but they were unable to keep the title-chasing Honest Men at bay.