Kilmarnock booked their place in the quarter-finals of the Betfred Cup as they squeezed past Hamilton after extra-time to ease the pressure on manager Angelo Alessio.
Three successive defeats, including the humiliating Europa League qualification exit to Welsh part-time outfit Connah's Quay, meant pressure was already building on Alessio.
But the Italian duly got the victory he needed as substitute Dom Thomas' strike in the second period of extra-time secured a crucial 1-0 win and saw Kilmarnock progress to the last eight of the competition.
Kilmarnock enjoyed the bulk of possession during the first half at Rugby Park but were unable to make the breakthrough.
They first threatened after 15 minutes when Stephen O'Donnell's cross was parried by Owain Fon Williams and fell for Rory McKenzie, who created space for his shot but saw his effort blocked by Aaron McGowan.
O'Donnell then forced Fon Williams into a save when he let fly from 25 yards and, although Hamilton's goalkeeper could only push the ball out, defender Sam Stubbs was on hand to put it over the crossbar before Eamonn Brophy pounced.
From the resulting corner Kirk Broadfoot, captain with Gary Dicker dropping to the bench, sent a free header straight at Fon Williams.
Hamilton's best chance of the first half came when Ross Cunningham found Darian MacKinnon on the left and he drilled a low ball across the face of goal which just evaded George Oakley.
After the break Innes Cameron sent a header over for Kilmarnock from Mohamed El Makrini's cross.
Killie defender Stuart Findlay produced a brilliant intervention to prevent Oakley from opening the scoring as he stretched out his leg to take Scott McMann's whipped cross off the head of the Hamilton striker.
Brophy was then presented with a great opportunity when he burst down the left flank into the area, but Sam Stubbs got across to make a timely challenge.
Kilmarnock's best opportunity arrived after 70 minutes when Brophy made space on the byline and then rolled a cut-back into the path of Liam Millar, but the substitute blasted his effort high over the crossbar.
With two minutes remaining Hamilton's McGowan came close to winning the tie in 90 minutes when he unleashed a powerful angled drive, but Laurentiu Branescu turned it round a post.
In the first minute of extra-time Hamilton carved out an opportunity as substitute Mickel Miller fizzed a low cross into the area that Branescu pushed back out into the six-yard box. The ball fell to Marios Ogkmpoe but it came too quickly for the sub to react and he proceeded to stab his effort wide.
In the 113th minute Kilmarnock edged ahead through Thomas.
When Greg Taylor's deep cross arrived at the feet of the substitute it initially appeared as though he was going to be crowded out at the far post.
However, he managed to squeeze the ball between Fon Williams and a post to finally settle the tie