Livingston held their nerve in a penalty shoot-out to reach the Petrofac Training Cup final at the expense of League One Stranraer at Almondvale.
Striker Jamie Longworth made the breakthrough for Stranraer at the end of a poor first half, creating space to lash home from the edge of the box.
Gary Glen finished off a good move with his left boot to level for Livingston.
Both sides had chances to win it in extra time, before Darren Jamieson saved Anthony Marenghi's spot kick.
The result will pain the part-timers as they looked the more likely team to find the winner as a penalty shoot-out loomed.
However, it is John McGlynn's side who go through to April's final where they will meet Alloa, East Fife or Rangers.
The Fifers play the Ibrox club on 21 October in their quarter-final tie with a semi-final against Alloa at stake.
In a first half of few real chances, Stranraer goalkeeper David Mitchell did well to tip over the bar an effort from Danny Mullen after he had cut in from the right.
Longworth was rewarded for seizing the initiative when he raced clear and before three yellow shirts could close him down he smashed in the opener.
McGlynn sent on Myles Hippolyte at half-time and then Glen on the hour mark to try to level the match and within six minutes the latter picked up a pass by the impressive Keaghan Jacobs and hammered a low shot past Mitchell from 20 yards.
Championship Livi had the best chances to win the match within 90 minutes, with Jacobs' flashing shot wide of the post the closest, while for Stranraer substitute Marenghi's long-range effort had to be watched closely by Jamieson before making the save.
In extra-time Glen was cynically hauled down by Grant Gallagher as he bore down on goal. Referee George Salmond flashed a yellow to the Stranraer full-back and from the free-kick 20 yards out Jacobs rolled the ball to Hippolyte, whose shot ricocheted out for a corner.
At the other end Jamieson managed an impressive double save in quick succession from Longworth and substitute Daniel Stoney, who had instigated the move with a blistering run down the left before setting up his team-mate.
Jamieson saved with his legs when one on one with Longworth in the final stages as Stranraer pushed forward for a late winner.
Kyle Jacobs, Hippolyte, Jordan White and Mark Burchill scored from Livi's first five penalties, with Glen blazing over, while for Stranraer Craig Malcolm smacked their first spot kick over the bar, before Sean Winter, Longworth, Stoney and Chris Aitken scored their efforts.
In sudden death, Livi skipper Jason Talbot found the target and Jamieson dived to his left to save from Marenghi to send the West Lothian side through.
- 5FordyceBooked at 90mins
- 17McKennaSubstituted forBurchillat 98'minutes
- 31RutherfordSubstituted forHippolyteat 45'minutes
- 20MullenSubstituted forGlenat 60'minutes
- 2GallagherBooked at 94mins
- 3LongridgeSubstituted forRussellat 105'minutes
- 8StirlingBooked at 68minsSubstituted forStoneyat 80'minutes
- 11GibsonSubstituted forMarenghiat 69'minutes
- 9MalcolmBooked at 91mins
- George Salmond
- Shots on Target