St Mirren warmed up for the arrival of new manager Jack Ross by knocking Championship rivals Hibernian out of the Scottish Challenge Cup.
Alex Harris fired Hibs into the lead eight minutes before the interval.
But the Buddies struck back with two goals hotly disputed by the hosts.
Hibs thought that Stevie Mallan's fine free-kick should not have been awarded and were dismayed when an offside flag for David Clarkson's winner was waved away by referee Willie Collum.
With Ross taking charge of his last game with Alloa Athletic, caretaker boss Allan McManus ensured the Paisley side joined the Wasps in the last eight of the tournament.
Having gone nine games without a win, the visitors worked hard to knock Hibs off their stride.
It was a fairly tepid opening 30 minutes, but a tactical switch by home manager Neil Lennon in moving Harris from right to left brought about an immediate impact.
The 22-year-old teased Saints defender Jason Naismith before cutting inside and firing a shot that drifted in at goalkeeper Jamie Langfield's near post.
Hibs' problems this season have been failing to kill teams off when in front and St Mirren drew level before the break thanks to a magnificent free kick by Mallan.
The award for a Dylan McGeouch tackle on Rocco Quinn was questionable, but the accuracy of the Mallan effort gave goalkeeper Ofir Marciano no hope.
After the break, James Keatings shot over from close range and McGeouch thundered a shot from 25 yards against the post as Hibs pressed.
But much of the Easter Road's side play was ponderous and several simple passes were misplaced, making it hard to build momentum.
With eight minutes remaining, St Mirren scored what proved to be the winning goal, and once again there was controversy.
Lawrence Shankland played the ball into the path of fellow substitute Clarkson and the striker's mis-hit shot was spinning towards the net as the former followed up.
Assistant referee Brian Templeton indicated offside but was overruled by Collum as Shankland had not touched the ball before it had crossed the line.
The home side, who have now gone four games without a victory, pushed more and more men forward and defender Jordon Foster missed a glaring headed chance as a Saints defence expertly marshalled by Gary Mackenzie and Jack Baird held firm.
- 8FyvieBooked at 90mins
- 33HarrisSubstituted forHoltat 84'minutes
- 22ShinnieSubstituted forBartleyat 69'minutes
- 17BoyleSubstituted forCummingsat 69'minutes
- 16WalshSubstituted forGallagherat 74'minutes
- 8QuinnSubstituted forClarksonat 63'minutes
- 14HuttonBooked at 47mins
- 9SuttonSubstituted forShanklandat 82'minutes
- William Collum
- Shots on Target