Two opportunist second-half goals gave Second Division Ayr United a surprise Challenge Cup first-round victory over First Division high-flyers Hamilton.
Accies took the lead after 19 minutes, when Stuart Taylor headed home a Kevin Davison cross at the far post.
Home keeper Bryn Halliwell saved a Michael Moore penalty before half time.
But three substitutions appeared to backfire on Accies as Moore struck the equaliser and Ryan Stevenson intercepted a backpass to score.
Hamilton: Halliwell, Wroe, Gibson, Stevenson, Evans, Easton (Gilhaney 62), Taylor (Elebert 55), McCarthy, Teggart (Wake 46), McLeod, Davison.
Subs Not Used: Crawford, Cerny.
Goal: Taylor 17.
Ayr: Corr, Swift, Pettigrew, Forrest, Robertson, Stevenson, Vareille, Weaver, Wardlaw (Moore 36), Williams, Dunn.
Subs Not Used: Henderson, Casey, Lowing, McGeown.
Goals: Moore 60, Stevenson 76.
Ref: M McCurry