Ayr got out of jail to book their place in the last eight of the Scottish Cup on a dramatic day at Somerset.
Dipo Akinyemi's extra time double helped an out of sorts United over the line as they saw off League Two Elgin City.
But boss Lee Bullen admits his side gained few plaudits on an afternoon where progress mattered at all costs.
He said: "As the time went on I didn't think we were going to get the break.
"We certainly didn't deserve it on our first half performance.
"The goal we lost was a schoolboy error and we had some choice words at half time.
"There was a lot more intent and belief after the break and our goal at the end was a dagger to Elgin.
"Are we happy with the performance? No. But we are in the hat and that is the main thing.
"Nobody remembers how you get through, it's just about getting there in cup competitions."
Elgin were on top from the off and always looked the more likely against an Ayr side who lacked urgency before the break.
United had a huge early escape when they needed Ben Dempsey to head off the line from Jake Dolzanski.
The visitors kept their foot on the pedal and Tom Findlay fired just wide after Aidan McAdams had saved from Owen Cairns. They duly hit the front just before the break as they got the goal their play had deserved.
A simple ball split the middle of Ayr’s defence and Kane Hester strode through to fire home his 26th goal of the season.
Bullen stuck with the same XI at the interval in a bid to turn the tide but they remained blunt in attack with Dipo Akinyemi cutting an isolated figure.
And Elgin could have been out of sight as they passed up a number of further chances.
Dolzanski had another header clawed off the line – this time by McAdams. Then full-back Cairns fired inches wide at the back post.
That sparked a triple change from Bullen and Ayr and in the 77th minute, sub Daire O'Connor laid on a chance for Akinyemi to fire over the top.
However, Elgin could have added to their lead as Russell Dingwall fired wide and then Darryl McHardy drew another top save from McAdams.
Then Ayr grabbed a lifeline in stoppage time when O’Connor’s cross was turned home as Fraser Bryden challenged his opposite number in the six yard box.
And Ayr could incredibly have won it when Akinyemi hit the post with the last kick.
That sent the game into extra time and Ayr quickly turned the tie when Dempsey converted a penalty after Akinyemi had been fouled by Ross Draper.
Ayr quickly buried the tie as Akineymi hit a double – finishing off after good work by O’Connor and then rifling home a fine solo effort.
Elgin boss Gavin Price said: "Over the 90 minutes I thought we deserved to win the game and to lose the goal at the end was absolutely sickening."
Don't miss the latest Ayrshire headlines – sign up to our free daily newsletter here