Manchester City had goalkeeper Joe Hart to thank as they fortuitously progressed to the Uefa Cup first round with a penalty shoot-out victory over FC Midtjylland.
Having lost 1-0 in the first leg at Eastlands earlier this month, City knew the size of the task ahead in their second qualifying round return leg at the SAS Arena in Herning.
But after an abject display in normal time it was only an own goal by defender Danny Califf in the 89th minute which forced extra-time and extended their interest in the competition.
And when Hart saved two penalties in the shoot-out, it was left to Vedran Corluka to stroke home the kick to spare City's blushes.
City, who reached the preliminary stages by virtue of their position in last season's Fair Play league, had faced a stern test against a well-organised and dynamic counter-attacking Danish side and were clearly the poorer of the two teams for the majority of the game.
They were boosted before kick-off by Micah Richards' rapid recovery from concussion and also by the signing of Shaun Wright-Phillips from Chelsea.
With Gelson Fernandes among the substitutes, Richards operated in midfield while Corluka lined up at right-back.
A sixth-minute Elano corner was only partially cleared, allowing Martin Petrov to hook the ball back into the area but Stephen Ireland fired wide on the half-volley as City looked to score the early goal.
Barely a minute later they needed goalkeeper Hart to keep the tie alive however.
When Jonas Borring beat the offside trap he looked set to double his side's aggregate lead, only for the England Under-21 international to make a smart save.
While Jo and Elano saw speculative shots fail miserably Borring, the Danes' chief playmaker, was proving to be more effective and had another well-struck shot comfortably saved by Hart.
First-leg goalscorer Danny Olsen had the best chance of the match up to that point when he moved to side-foot home Borring's low centre in the 28th minute, only to be denied by an excellent sliding block by left-back Michael Ball.
City continued to labour, devoid of creative ideas, until Jo headed out to the left flank and forced Midtjylland to scramble his cross clear, while Petrov fired in an effort from an acute angle which Lasse Heinze got down well to save two minutes before the break.
City won a corner early in the second half when Jo was beaten to a header and from the resulting set-piece, Richards' header was blocked before Petrov's shot was similarly turned away.
Hughes sent on Dietmar Hamann and Daniel Sturridge for Tal Ben-Haim and Elano shortly before the hour mark with Richards moving into central defence.
Hart was forced into action to clear the danger on the edge of his area after Mikkel Thygesen found himself through on goal beyond the flat-footed City defence.
Midtjylland boss Thomas Thomasberg sent on young striker Collins Babatunde for Jude Ikechukwu Nworuh.
Substitute Collins almost made an immediate impact with a glanced header but saw his effort fly narrowly wide of the far post only for two more dangerous chances to also go to waste.
Richards was booked for an innocuous-looking challenge before Claus Madsen was introduced by the home team.
Ched Evans was sent on for the ineffective Jo and soon had an impact.
The goal City craved so desperately came from nothing in the 89th minute when Evans failed to properly connect with Ball's cross and the ball was deflected past despairing goalkeeper Heinze by defender Califf.
Extra-time began without incident until the 96th minute, when Sturridge expertly put Michael Johnson through on goal only for the midfielder to see his effort saved by the advancing Heinze. When the ball was crossed back into the area, Ireland could not head on target.
Sturridge was looking lively and struck the bar in the 103rd minute after receiving the ball on the right following Hamann's brilliant tackle outside the Midtjylland area.
In the second half Gheorge Florescu struck a powerful shot but Hart got down to hold on to the ball while Johnson fired just wide five minutes later.
Hart was forced to tip the ball over the bar when substitute Frank Kristensen shot on the turn in the 117th minute but penalties beckoned when neither side produced a winning goal.
Evans took the first penalty and scored while Petrov converted his but after Winston Reid and Christopher Poulsen also scored, Johnson saw Heinze dive to save his spot-kick.
Borring also saw his saved, however, before Hamann's kick beat the goalkeeper.
Hart then gave his side the advantage when Kolja Afriyie had his kick saved and Corluka converted his kick to send Hughes' side through.