Rangers kept their hopes of reaching the quarter-finals of the Champions League alive when they twice fought back from a goal down to earn a draw against Villarreal at Ibrox.
Juan Roman Riquelme's early penalty was cancelled out by Peter Lovenkrands and Diego Forlan appeared to have bagged the winner for Villarreal.
However, there was a twist still to come when an own goal from Juan Manuel Pena threw the Scottish champions a lifeline with just eight minutes to go.
Rangers did not quite manage to sink the team dubbed the Yellow Submarine but they will be hopeful of making the most of the return leg in Spain in a fortnight's time.
As well as reaching the last 16 of the Champions League for the first time, both teams had a disastrous domestic campaign in common but Villarreal recorded their best result of the season when they defeated Espanyol 4-0 at the weekend.
Rangers had also bounced back from three consecutive defeats to secure a much-needed victory over Hibernian and eyebrows were raised when Alex McLeish opted to change that winning team for tonight's game.
Lovenkrands was given the nod ahead of Kris Boyd, the former Kilmarnock player who lacked experience of European football.
But a more surprising move was the decision to relegate Thomas Buffel to the bench in favour of Hamed Namouchi, earning him his first involvement since returning from the African Nations Cup with Tunisia.
Indeed, his name was greeted by confused silence from the supporters when the teams were read out prior to the game.
But it was a far more experienced campaigner, former Champions League finalist Dado Prso, who cost Rangers the opening goal when he foolishly handled in the area.
French referee Eric Poulat immediately pointed to the spot and the talismanic Riquelme - back from injury - converted with ease from 12 yards.
Villarreal coach Manuel Pellegrini had missed last night's training session and press conference because of family problems and the entire team, led by Riquelme, made a bee-line for the dug-out to celebrate with their manager.
But it was Rangers who now had problems. The Scottish champions were rattled at losing the early goal and they could only breathe a sigh of relief when a Gonzalo effort was ruled offside soon after.
But gradually the Ibrox side forced their way back into the game and they were back on level terms after 23 minutes.
Chris Burke delivered some superb build-up play before squeezing the ball into the path of Lovenkrands and he left goalkeeper Sebastian Viera with no chance when he rifled home from the edge of the box.
Rangers were briefly in the ascendancy after that but the stuffing was knocked out of them again when Villarreal restored their lead 10 minutes before the break.
Gonzalo played the ball into the path of Forlan and he took advantage of a sluggish Rangers defence to ram into the roof of the net.
Forlan and Jose Mari had both been in an offside position before Gonzalo received the pass from Riquelme, and the Ibrox crowd screamed their dissent, but there was little doubt about the positioning of the former Manchester United striker for the goal.
Rangers knew there was no time to waste and they quickly set about trying to put the Villarreal defence under pressure after the restart.
Full-back Alan Hutton tried his luck with a long-range effort and, surprisingly, his shot was not too far away after taking a slight deflection off a yellow shirt.
Another defender, Julien Rodriguez, then nodded just over the crossbar from Lovenkrands' inswinging corner-kick.
Rodolfo Arruabarrena was the first player of the game to be booked for a lunge on Burke after 54 minutes.
Rangers had another decent chance when Burke slotted into the path of Lovenkrands in front of goal but, before he could pull the trigger, he was robbed of possession by Gonzalo.
Villarreal made their first change of the game after an hour when Arruabarrena made way for Juan Pablo Sorin, who was making his return from injury.
The Spanish outfit then handed out a timely reminder that they were capable of scoring more goals when Riquelme carved open the Rangers defence and released Forlan into the box only for the striker to deliver a weakly-hit effort.
The sight of Buffel stripping for action met with the approval of the home support and he replaced Namouchi with almost 70 minutes gone.
As well as having his name on the scoresheet, Forlan was added to the referee's book for a trip on Hutton as Rangers pushed forward in search of the equaliser.
Spanish striker Nacho Novo was thrown into the action against the team from his homeland in the hope of making an impact.
But it was a far more surprising source which provided Rangers with the equaliser after 82 minutes when a Buffel cross was deflected into the back of his own net by Pena as Ibrox erupted.
Teams
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.
Att: 49,372
Ref: Eric Poulat (France).