Debutant David Robertson was the hero as Livingston beat Queen of the South 4-3 after extra time in a Petrofac Training Cup thriller.
Queens appeared on course for the second round after Andrew Dowie's 24th-minute header was followed by Iain Russell's close-range strike 10 minutes into the second half.
Craig Sives nodded home two minutes later to give Livi hope and they were level on 65 minutes when Daniel Mullen's right-footed effort found the back of the net.
The visitors drew first blood in extra time as Myles Hippolyte marked his debut with a left-footed finish midway through the first period but they were pegged back by Michael Paton's shot into the bottom corner just after the break.
The stage was then set for Robertson to fire home from six yards to get Livingston's season off to the perfect start.