Abbey Vale came from two goals down to knock Stranraer out of the Cree Lodge Cup on Saturday.
The game was moved to Dumfries High School and the visitors took a 1-0 lead at the break.
They doubled their advantage in the second half, only for Dan Thom to reduce the deficit almost immediately.
Stranraer then gave away a penalty and had a man sent off but the spot-kick was missed.
However, Craig Kerr headed Vale level late on before Adam Kirk scored a dramatic winner in the dying seconds.
Vale co-manager, Allan Clark, said: “We just weren’t at it in the first half. I think we were quite lucky to go in at 2-0. Things just didn’t happen – right through from the goalkeeper to the strikers.
“To give the boys their due they were much better in the second half. They completely changed the way they were playing, they raised the effort and the tempo was tremendous.
“The boys always know when they’re not up to their standards and they knew they hadn’t fulfilled their potential in the first half.
“We made a couple of subs at half-time, then had to make another change when one got injured within five minutes.
“I thought we were going to be a bit unfortunate when we missed the penalty, then when we got the second I thought we were on for extra-time before we got the winner.
“They are a good, young, fast team so it was pleasing to get the result and get through to the semi-final.
Vale have no game this weekend with their next match due to be against Threave Rovers on March 5.
The plan is for the players to have some time off to allow injuries to clear up.
This weekend they make the short trip to Wigtown in the Tweedie Cup.