Rangers booked their spot in the quarter finals of the Scottish Cup as Oscar Cortes impressed on his first start and Fabio Silva notched his second goal in light blue.
But the Ibrox side were made to fight as Scott Brown’s fired-up Championship side produced a performance reflective of their boss and were well in the game until Silva’s 76th minute clincher.
In the end the home side had too much quality with Ayr and Brown - who earned himself the third biggest cheer of the evening by picking up a second half booking - left to focus on their play-off ambitions.
Cortes was the brightest spark for Rangers and almost had his first Gers goal after just a minute and 15 seconds when he cut in off the left and sent a right footed shot flashing off the far post.