(Aggregate score 1-1 - Rangers through on away goals)
Nacho Novo's late strike sent Rangers into the last 16 of the Uefa Cup on away goals after trailing Panathinaikos for the majority of a pulsating tie.
Novo's priceless away goal came when Rangers looked down and out
The hosts started strongly and Allan McGregor pulled off several fine saves but couldn't keep out Ioannis Goumas' spectacular 12th-minute volley.
As Panathinaikos continued to dominate McGregor denied Giorgos Karagounis and Loukas Vyntra with acrobatic stops.
But Novo's 81st minute equaliser gave Rangers the priceless away goal.
Rangers manager Walter Smith laid down the gauntlet to Panathinaikos, abandoning his tried and trusted 4-5-1 formation and fielding strikers Kris Boyd and Novo in an attacking starting XI.
The Greeks made two changes to the side which drew 0-0 in the first leg in Glasgow.
Portugese striker Helder Postiga came in for Dame N'Doye while set-piece specialist Aendreas Ivanschitz replaced Simao in midfield.
The match began at a frantic tempo and it was Rangers who registered the first effort on goal.
Boyd took advantage of a slip by Goumas and but his snap shot from the edge of the penalty area flew just wide of the right post.
Panathinaikos responded immediately when Alexandros Tziolis fired a shot from distance over the bar.
The Ibrox side had begun brightly and continued to threaten the Greeks' rearguard - Boyd just failed to connect with a dangerous right-wing cross from Kirk Broadfoot.
But the visitors were forced to defend when Sasa Papac brought down Karagounis to concede a free-kick in a dangerous right-wing position.
Ivanschitz drew a fine save from Allan McGregor with a stinging shot and Marcelos Mattos' shot was blocked by a sea of defenders.
But Rangers found themselves a goal behind after 12 minutes courtesy of a stunning effort from the most unlikely of sources, Greece centre-back Goumas.
The veteran defender gathered the ball 30 yards out, held off the challenge of Brahim Hemdani and sent a looping volley high beyond the flailing fingertips of McGregor.
Goumas drew another superb save from McGregor with a fierce volley from the edge of the penalty area 10 minutes later.
And Carlos Cuellar's perfectly timed sliding tackle prevented Postiga from doubling Panathinaikos' lead after 33 minutes.
Rangers weathered the storm and almost grabbed an equaliser three minutes before the break.
Papac's inswinging cross from the left found Novo in space at the back post.
The Spaniard took the awkward high ball on his chest before stepping inside and unleashing a left-foot volley that Mario Galinovic did well to palm over the bar.
The Greeks continued their shoot-on-sight policy as the second-half unfolded and Karagounis brought out the best in McGregor again with a powerful drive.
McGregor kept the tie alive when he turned Ivanschitz's long-range effort round his right-hand post.
Rangers once again survived the onslaught and started to impose themselves on the Greeks but, despite a period of tidy possession play, failed to threaten Galinovic's goal.
With a goal desperately needed, Smith brought on striker Steven Naismith for left-back Papac, while Christian Daily replaced Charlie Adam after 65 minutes.
And with his final change, Smith introduced Chris Burke on 70 minutes for Hemdani.
But the hosts looked more likely to stretch their slender lead and McGregor was called on again to tip Vyntra's shot round the left post.
Out of nowhere, Rangers drew level when Barry Ferguson's floated crossfield pass picked out Burke on the right.
The winger's probing low cross from the right was missed by the Greek defence and the ball rebounded to Novo, who lashed the ball into the corner of the net.
The visitors played out time to claim a first-ever success for a Scottish club on Greek soil, and, more importantly, take their place in the last 16 of the competition.
Rangers now move on to the last 16 where they will take on German side Werder Bremen, with the first leg at Ibrox on 6 March.
Panathinaikos: Galinovic, Vyntra, Morris, Goumas, Nilsson (Papadopoulos 86), Mattos, Karagounis, Tziolis (Gonzalez 83), Ivanschitz, Postiga (Ndoye 62), Salpigidis.
Subs Not Used: Malarz, Ninis, Seric, Simao.
Goals: Goumas 12.
Rangers: McGregor, Broadfoot, Papac (Naismith 66), Weir, Cuellar, Novo, Ferguson, Hemdani (Burke 69), Davis, Adam (Dailly 66), Boyd.
Subs Not Used: Alexander, Gow, Buffel, Cousin.
Goals: Novo 81.
Ref: Felix Brych (Germany).