First Division Ross County needed a last-gasp penalty from Kevin McKinlay to see off Alloa in the Challenge Cup.
The tie looked to be heading for a penalty shoot-out before substitute Craig Gunn was hauled down inside the area and McKinlay stepped up to score.
Second Division Athletic had got off to a flyer when Chris Townsley scored with a free kick in the first minute.
But McKinlay finished off fine work from Sean Higgins, who had a penalty saved, before the late winner.
Ross County: Malin, Gary Irvine, Keddie, Niven, McCulloch, Tiernan (Anderson 99), Gardyn (Scott 105), Adams, Higgins (Gunn 99), Cowie, McKinlay.
Subs Not Used: Robertson, Ridgers.
Booked: Keddie, Higgins, Gardyn, Niven.
Goals: McKinlay 62, 120 pen.
Alloa: Creer, Ovenstone, Bolochoweckjy, Townsley, Malcolm, McColligan (Comrie 90), Grant, McKeown, Hazeldine (Brown 62), McCalum (Hamilton 75), Sloan.
Subs Not Used: Kelly, Hutton.
Booked: McColligan, Bolochoweckjy, Creer.
Goals: Townsley 1.
Ref: S Finnie (Scotland).