Lukas Fadinger scored his second late Premier Sports Cup winning goal of the campaign to inch Motherwell through to the last eight with a 1-0 victory over St Johnstone after extra-time.
Last year’s Premiership relegated side were holding firm until the 108th minute when Austrian midfielder Fadinger sneaked in behind Reghan Tumilty to connect with an excellent Elliot Watt pass.
Fadinger, who scored in the 90th minute to beat Peterhead in the group stages, squeezed a finish past Toby Steward from an awkward angle.
Watt, who played nine games on loan for the Perth club last season, made the difference with the killer pass of the day.
With Lennon Miller settling into Serie A life with Udinese and Callum Slattery banned, Motherwell were minus two top midfield talents from the last time the teams met.
Motherwell bossed possession once again but found clear-cut chances elusive, with a Paul McGinn hook shot from a corner going close after four minutes.
Saints boss Simo Valakari switched to a back three as Morgan Boyes returned from missing the first two Championship games through suspension.
The former Morton defender saved the day for Saints after 34 minutes with a superb clearance off the line.
Cutting in from the left, Manny Longelo’s shot evaded Steward and Boyes slid in to somehow lift the ball over the crossbar.
Valakari addressed his side’s lack of first-half threat by bringing on Uche Ikpeazu at the interval.
Tumilty replaced Sven Sprangler to give Saints a more conventional right-back match-up for the dangerous Longelo and reverted to a back four.
Motherwell were angered by referee David Dickson not only denying them a 50th-minute penalty but booking Stephen O’Donnell for simulation under an Adama Sidibeh challenge.
The visitors began to find spaces in the final third when at their most menacing, for the first 20 minutes of the second half, but Jack Baird and Cheick Diabate were in the right place to repel when it mattered.
And Steward comfortably dealt with efforts from Longelo, Tawanda Maswanhise, Watt’s free-kick and substitute Andy Halliday.
Saints had two big second-half opportunities as first, Makenzie Kirk latched onto an Ikpeazu flick but Calum Ward dashed out to close the angle and force the shot wide.
Then, in stoppage time, an unmarked Jason Holt strode onto a Kirk lay-off and missed by inches from 16 yards.
Kirk struck the base of the post early in extra-time and Elijah Just sliced an attempt into the side-netting for Motherwell.
However, the Premiership side – with new Nottingham Forest loan forward Esapa Osong making his debut – wore the hosts down and Fadinger had the final say.