A strong second half showing from Arbroath, including two goals in a 10-minute spell, earned them a crucial three points in their battle to avoid relegation.
The first half was largely a non-event, although it sprung to life around the 30-minute mark when Ayr struck the woodwork twice in five minutes. From a Craig Conway corner, Neil Inglis pushed an Andrew Ferguson header on to the bar before Gareth Wardlaw also hit the bar with a header from four yards.
Having not created a clear-cut chance in the first half, Arbroath emerged for the second period with the look of a side determined to score their first goal this year.
They nearly broke their duck after 51 minutes when Alan Brazil's shot was parried by Ludovic Roy and Gavin Swankie's follow-up effort was cleared off the line by William Lyle.
However, an error from the erratic Roy then gifted Arbroath the lead. Under pressure from Steven Rennie, the Ayr keeper dropped the ball from a Swankie corner and Greig Henslee fired the ball home.
Ten minutes later, Arbroath doubled their lead and Roy was again found wanting. He could only flap at a Swankie cross to the back post, and Brazil scored with a header from two yards.
That goal killed off the game, and although Craig Conway hit the post from 20 yards late on, Ayr were never at the races today and Arbroath deserved the win.