Rangers went through to the group stages of the UEFA Cup by the narrowest of margins as they edged out Portuguese side Maritimo 4-2 on penalties at Ibrox.
Alex McLeish's side dominated from the start and as the match went into extra-time were left ruing missed chances and refereeing decisions which seemed to go against them.
Dado Prso grabbed the crucial goal for Rangers on 74 minutes to get them back on terms after their first-leg defeat. But Prso and strike partner Nacho Novo passed up numerous chances during the match as Maritimo goalkeeper Marcos Oliveira performed heroics.
But it was Rangers who held their nerve in the penalty shootout with substitute Gregory Vignal putting away the decisive spot-kick.
From the start Rangers were in control. On 20 minutes Steven Thompson's header went narrowly over the bar before landing on the top of the net.
It was Marcos who kept his side in the game during the first half, tipping Novo's header over the bar on 28 minutes and making a spectacular save from a Prso free-kick a minute later.
In the final minute of the period Rangers had a penalty claim turned down after Maurice Ross went down in the box.
Rangers immediately stamped their mark on the second half when Novo sent in yet another header which forced Marcos into a diving save after less than two minutes, and a minute later they had a second penalty claim turned down after Paolo Vanoli fell on the edge of the area.
Novo had several more efforts saved by Marcos but it looked to be just a matter of time before Rangers hit the back of the net.
Prso made the breakthrough after 74 minutes when the ball fell loose just inside the 18-yard box and he struck low into the net to put the Glasgow side back on terms.
Tempers flared straight after the goal following an off-the-ball incident involving Zurab Khizanishvili and Leo Lima, and Rangers frustrations deepened when Prso netted for a second time on 80 minutes but was judged to have been offside.
As the game went into extra-time tiredness showed in both sides and scoring chances were few and far between. Novo had a chance to separate the teams on 116 minutes when he was given a free shot from ten yards out but sent it over the bar.
Novo finally hit the back of the net as his penalty went in off the crossbar, while Prso, Thompson and Vignal all found the target.
The pressure showed on the Maritimo players after Stefan Klos saved Chaino's penalty and Ferreira put the final nail in his side's coffin as he struck the crossbar, sending Rangers through to the group stage.