Ayr United knocked Queen of the South out of the Challenge Cup after a tense penalty shoot-out at Palmerston.
The visitors went in front thanks to a Chris Robertson penalty on 50 minutes but John O'Neil hit back with a neat, clipped shot soon after.
Jim Lauchlan produced a dazzling finish to put the home side in the driving seat but Paul Weaver's last-minute shot was deflected in off Scott McKenzie.
Following extra-time, Andy Thomson was the only man to miss from the spot.
Queen of South: Corr, Callaghan (Robertson 75), Lauchlan, McKenzie, Paton, Scally, Burns, Henry (O'Neil 59), Gibson, Andy Thomson, Mullen (Moon 59).
Subs Not Used: Scott, Sloan.
Booked: Andy Thomson.
Goals: O'Neil 63, Lauchlan 78.
Ayr: McGeown, Lowing, Forrest, Robertson, Creaney (Walker 70), Casey, Dunn, Hyslop (Strain 83), Weaver, Friels (Vareille 83), Wardlaw.
Subs Not Used: Logan, Johnson.
Goals: Robertson 50 pen, Weaver 90.
Ref: J Underhill (Scotland).