Livingston crowned their memorable comeback with a 119th-minute winner to knock out Partick Thistle and secure a place in the Scottish Cup last eight.
Kerr McInroy's 30-yard thunderbolt and a powerful Aidan Fitzpatrick effort gave second-tier Thistle a seemingly comfortable cushion with under half an hour left.
But Joel Nouble's double, a tap-in and then a toe-poke, brought the visitors level to force extra time before Tete Yengi's header gave the Premiership bottom side a dramatic win.
Livingston will feature in Sunday's quarter-final draw live on BBC One Scotland.
Livingston's only win since October came in the Scottish Cup against Raith and provided respite from their wretched league form.
They started well, but it was Thistle who opened the scoring just shy of the half-hour mark. Thirsty yards out, McInroy was invited to shoot by the Livingston defence and he swiftly rocketed his shot into the bottom corner.
Things got worse for Livingston as they lost Scott Pittman and Shaun Donnellan to injury before half-time, but the changes worked and they had the ball in the net.
The celebrations after Yengi's header were short-lived, though, as referee Nick Walsh blew for a foul in the build-up.
Thistle made the most of that reprieve when Fitzpatrick scored the second just after the hour. Skipping on to his right, the winger powered in a shot that goalkeeper Michael McGovern could not hold.
Livingston weren't dead yet. A brilliant corner from the left found the head of Ayo Obileye, and when Jamie Sneddon saved the initial header, Nouble was on hand to tap in.
Thistle were shaken, Livingston were stirred. They pounded on the door looking for an equaliser, and it came when Nouble got the ball deep in the Thistle box and toe-poked into the top corner.
There was a chance for Thistle to win it in the 90 minutes when Tomi Adeloye sent a dipping, curling shot at goal but it smacked the upright.
Livingston kicked on in extra time, but Jamie Sneddon produced a few fine stops to keep the scores level and set himself up to be the cup hero.
Instead, it would be Yengi. The big Australian met a cross from the right with a glancing header that bounced in off the back post for a moment he will never forget.
Player of the match - Joel Nouble
Reaction to follow.
Life and death decisions on the frontline: The Bafta award-winning Ambulance returns to Greater Manchester
How is Irish stout made? Gregg Wallace goes Inside the Factory to find out...