Substitute Chris Erskine scored the second of two last-minute goals as Partick Thistle came from behind to beat Queen's Park in a thrilling Ramsdens Cup tie.
The Third Division hosts took the lead through Lawrence Shankland before Aaron Sinclair levelled on 34 minutes.
Christie Elliot gave the First Division visitors the lead going into half-time but the best was yet to come.
Jamie Longworth equalised shortly after the break before Erskine gave the lead back to Thistle with his first goal of the night.
The home side then scored twice in quick succession through Anthony Quinn and Richard Little, and with just five minutes to go, their place in the third round looked safe.
However, the game looked set for extra time when Partick's Stuart Bannigan equalised in the last minute and Erskine broke Queens Park's hearts with a dramatic winner.
Queen's Park: Parry, Little, Brough, Bradley, Robertson, Capuano (Smith 80), Longworth, Keenan, Ronald (Sean Burns 46), Quinn, Shankland. Subs Not Used: Lockhead, Gallagher, Watt.
Booked: Keenan, Quinn. Goals: Shankland 18, Longworth 54, Quinn 81, Little 86.
Partick Thistle: Scully, O'Donnell, Muirhead, Balatoni, Sinclair, Paton, Craigen, Welsh (Erskine 8), McGuigan (Lawless 56), Elliot (Doolan 83), Bannigan. Subs Not Used: Fox, Murray.
Booked: Bannigan, Paton. Goals: Sinclair 34, Elliot 40, Erskine 65, 90 Bannigan 90.
Ref: Crawford Allan