Rangers twice came from behind to give themselves a fighting chance in the second leg of their Champions League tie with Villarreal.
Peter Lovenkrands scored Rangers' first goal
Playmaker Juan Roman Riquelme opened the scoring for Villarreal from the penalty spot after a handball by Rangers' Dado Prso following a corner.
Peter Lovenkrands drove in the equaliser from the edge of the box.
Diego Forlan fired Villarreal back in front, but Juan Manuel Pena flicked a Thomas Buffel cross into his own net.
It is the first time both clubs have reached the last 16, and they enjoyed timely victories at the weekend after disappointing domestic runs.
Rangers boss Alex McLeish sprung a surprise by including Hamed Namouchi in midfield ahead of Buffel, while Lovenkrands replaced Kris Boyd up front.
Villarreal were boosted by coach Manuel Pellegrini, who had been absent from training on Tuesday while tending to his ill wife, making a late appearance on the bench.
He had gambled on giving a start to Riquelme, who had missed their previous 10 games with a knee problem, and the Argentine was on the scoresheet after just eight minutes.
Prso inexplicably raised an arm as he appeared to misjudge a Rodolfo Arruabarrena corner, and Riquelme coolly lifted the resulting penalty kick into the roof of the net.
Namouchi sliced a 22-yard drive wide following a good, thrusting run by Stevie Smith.
But Gonzalo Rodriguez had the ball in the net only to be ruled offside after a Riquelme free-kick caused havoc in the Rangers penalty box.
Riquelme (right) was influential on his return from injury
Lovenkrands equalised after a mazy run by Chris Burke was thwarted on the edge of the area, the Dane sending a curling, first-time, 18-yard drive into the top corner of the net.
Forlan slotted the ball past Rangers goalkeeper Ronald Waterreus, but again the referee's assistant ruled the Villarreal player offside.
The former Manchester United striker looked unlucky on that occasion.
But he appeared to be more clearly offside when thumping a drive into the top corner of the net from 12 yards following another dangerous Riquelme free-kick to put Villarreal ahead once more.
Forlan did beat the offside trap from a subsequent Riquelme through-ball, but Waterreus blocked the Uruguay striker's effort with his legs.
Julien Rodriguez headed just over as Rangers pressed after the break, but they were finding it difficult to create clearcut chances.
Villarreal continued to be dangerous on the break, but it was Rangers who made the vital late breakthrough thanks to substitute Buffel.
Rangers: Waterreus, Hutton, Rodriguez, Kyrgiakos, Smith, Burke, Hemdani, Ferguson, Namouchi (Buffel 69), Prso (Kris Boyd 89), Lovenkrands (Novo 75).
Subs Not Used: Klos, Ricksen, Andrews, Murray.
Booked: Rodriguez, Prso.
Goals: Lovenkrands 22, Pena 82 og.
Villarreal: Viera, Javi Venta, Pena, Rodriguez, Arruabarrena (Sorin 61), Senna, Josico, Riquelme (Arzo 90), Tacchinardi, Forlan, Jose Mari (Roger 84).
Subs Not Used: Barbosa, Guayre, Calleja, Hector Font.
Booked: Arruabarrena, Forlan, Viera.
Goals: Riquelme 8 pen, Forlan 35.
Ref: Eric Poulat (France).