St Mirren's hopes of reaching the Premier Sports Cup quarter-finals were ended after a penalty shoot-out loss at Livingston.
Conor McCarthy's late goal took the match to extra-time after Alan Forrest had given Livingston the lead.
Neither side could make the breakthrough in the added 30 minutes with the game heading to a penalty shoot-out. Despite Jamie McGrath, Joe Shaughnessy and Lee Erwin netting from 12 yards, Saints lost 4-3.
Both sides had chances in the opening stages of the match with Odin Bailey sending an effort just wide of the post on 14 minutes for the home side. Saints passed up a gilt-edged chance seven minutes later when Greg Kiltie had an abundance of time and space in the box, but had his low effort pushed away by Livingston goalkeeper Max Stryjek.
The Buddies were having the best of the first-half and again had another opportunity after a brilliant bit of skill from McGrath allowed the Irishman to fashion space on the left-hand side before clipping a wonderful ball into area. Richard Tait was leaning back as he managed to get his head on it but flicked wide.
Despite Saints' pressure, Livi took the lead with four minutes of the half remaining. Sibbald drove forward and slipped through to Forrest who had burst down the left channel unopposed. The winger made his way into the box before slotting beyond Jak Alnwick to open the scoring.
St Mirren should have been level immediately though when Brophy broke the offside trap and raced clear on goal a minute later. The forward was one-on-one with Stryjek but had his low strike blocked by the goalkeeper. Stryjek couldn't hold which allowed Brophy a second bite at it, but he sent wide from an angle with Livi defenders having got back on the line to cover.
The second-half was a scrappy affair with neither side creating much in the way of goal-mouth opportunities and with time ebbing away it looked like it wouldn't be St Mirren's day.
But with less than 10 minutes of normal time left, Saints found a leveller through substitute McCarthy. A free-kick on the left was swung in deep to the back post by Scott Tanser with McCarthy ghosting in ahead of the Livingston defence to slam home.
And Saints thought they were ahead just a minute later when Curtis Main had the ball in the net, only for the far side linesman's offside flag to be raised.
Conor McCarthy celebrates levelling for Saints.
The game went to extra-time and Livingston were convinced they had scored with 10 minutes remaining. An Ayo Obileye header came crashing off the post with Nicky Devlin forcing the rebound goal-ward. It was scooped up on the line by Alnwick with the Livi players and supporters protesting to the referee and linesman that it had crossed the line.
Despite being forced to play the remainder of extra-time with 10 men when Tanser had to come off injured, Saints took the match to penalties.
McGrath, Shaughnessy and Erwin all scored from the spot, while Alnwick saved from Keaghan Jacobs and Craig Sibbald. But Stryjek stopped the decisive penalty from Kyle McAllister in sudden death to give the West Lothian side the victory.
Full-Time: Livingston 1-1 St Mirren (Livingston win 4-3 on penalties)
St Mirren: Alnwick, Fraser (McAllister 72), Shaughnessy (c), Dunne (McCarthy 27), Tait (Henderson 58), McGrath, Kiltie (MacPherson 58), Erhahon, Tanser, Main, Brophy (Erwin 91)
Subs Not Used: Lyness, Finlayson, Flynn, Jack
Livingston: Stryjek, Devlin, Fitzwater, Obileye, Longridge (Jacobs 103), Holt, Pittman, Sibbald, Bailey (Kelly 62), Forrest (Hamilton 66), Anderson (Panayiotou 66, Shinnie 78)
Subs Not Used: Bardon, Reilly, Bartley
Referee: David Munro
Assistant Referee: Frank Connor
Assistant Referee: Graham Chambers
Fourth Official: Gavin Duncan