TEN-man Connah's Quay produced a sensational finish at Maes Tegid to end Bala's hopes of a last four spot.
An 87th-minute goal from Mark Griffiths looked to have booked the Lakesiders' ticket, but two goals in stoppage time put Nomads into the semis for the first time in 16 years.
Town took the lead on the quarter-hour when Ross Jefferies headed past keeper Terry McCormick at the far post, but a speculative shot from defender Allan Glover levelled the tie when his 30-yarder caught Leon Bimpson off his line.
The game looked over for Nomads when defender Ben Alston was red-carded and Griffiths headed Bala back in front.
But, when Bimpson could only parry Sam McNutt's long range shot, sub Mike Hayes was on hand to convert the rebound.
And, in the 93rd-minute, McNutt caught the home defence flat-footed to fire the winner.
Report and stats courtesy of welsh-premier.com