Shay Given was Manchester City's penalty shoot-out hero as Mark Hughes' side edged past Aalborg to seal a place in the last eight of the UEFA Cup.
City appeared to be easing their way into the quarter-finals until the last six minutes of normal time when the Danish side scored twice to make it 2-2 on aggregate and force extra-time.
There were no more goals in the extra 30 minutes but former Newcastle United keeper Given saved from Thomas Augustinussen and Luton Shelton in the shoot-out as City eventually won 4-3 on penalties.
At the start of the game Robinho had an early effort blocked while Ched Evans also wasted a good opportunity.
Stephen Ireland's16th-minute shot curled over while at the other end Aalborg were restricted to several promising crosses that eventually came to nothing.
Nedum Onuoha cleared a dangerous ball that was meant for Shelton away for a corner while Robinho was denied by goalkeeper Karim Kaza just before the break.
Aalborg began to look more dangerous in the opening moments of the second period and Caca hit a low shot just wide of Given's left-hand post before the referee waved away further penalty appeals when City substitute Javier Garrido appeared to bring Andreas Johansson down.
The game appeared to be heading towards a goalless draw until the 84th minute when Shelton lashed the ball home just after Robinho had hit the crossbar for the visitors.
As the game moved into stoppage time, Aalborg grabbed a dramatic second goal when Evans handled the ball inside the area and Michael Jakobsen slammed home the resulting penalty.
But City held their nerve in the shoot-out, scoring all four of their spot-kicks while Given kept out efforts by the unfortunate Augustinussen and Shelton.