Celtic reached the Champions League last 16 for the first time since 2008 with a tension-packed 2-1 win over Spartak Moscow at Celtic Park in Group G.
With Barcelona and Benfica drawing 0-0 at the Camp Nou, Neil Lennon's team progress as runners-up behind Barcelona - who wound up with 13 points - courtesy of Kris Commons's winner with a penalty kick on 82 minutes after Marek Suchy was harshly deemed to have brought Georgios Samaras tumbling to the ground.
Commons kept his cool before 59,000 home fans in a freezing Glasgow to ram the ball down the middle off the bar.
Commons did not finish the match after he was carted off and Kim Kallstrom sent off for a second booking after bringing the Scotland player crashing to the ground with a horrid tackle late in the game.
Both teams finished the match with 10 men, but the relief among the home fans was palpable when the news broke that Benfica had been held by a makeshift Barca side before the final whistle sounded seconds later amid scenes of bedlam inside Parkhead.
Celtic had struck first with their only real opening of the first half as Gary Hooper thumped the ball through the legs of visiting goalkeeper Sergey Pesjakov on 21 minutes after an awful error by Juan Insaurralde in failing to control the loose ball.
Spartak deservedly drew level on 39 minutes as the constantly classy Emmanuel Emenike slipped the ball into the path of Ari, who lifted the ball over Fraser Forster to level at 1-1 with Kelvin Wilson ending up in the net as tried to in vain to head over the bar.
It could be argued that Forster went to ground too soon, but it was difficult to claim the 1-1 scoreline at half-time was unjust.
Celtic were the better side in the second half with Samaras hitting a post with a volley soon after the restart and Charlie Mulgrew seeing a header nudged over the bar by Sparak goalkeeper Sergey Pesjakov as it looked like it was going to be an evening of hard luck for the home team.
They got what they deserved with their late winner. Celtic went with four men up front as Lassad Nouioui was introduced for the tireless Baram Kayal even if Samaras was barely touched when he went to ground.
Celtic qualified with 10 points behind Barca, who had already won the group with their 3-0 victory over Spartak in Moscow a fortnight ago.
It is the Glasgow side's highest points total in the Champions League group stage and is a remarkable achievement given the budget of the club compared to some of their wealthy rivals in the section and their seeding of fourth ahead of the draw.
Benfica finished in third place on eight points, two points behind Celtic. The Portuguese side must now content themselves with a place in the Europa League while Spartak lost 3-2 to Celtic at home and 2-1 in Scotland in finishing bottom of the section, with a win over Benfica their solitary success from the group stage.
They sacked former Valencia manager Unai Emery during a forgettable run of recent results. Stand-in coach Valery Karpin should be content enough with this showing, especially in the first half.
Celtic could face Manchester United, PSG, Schalke, Malaga, Borussia Dortmund, Bayern Munich or Juventus in the knock-out stages.
MAN OF THE MATCH
Emmanuel Emenike - Spartak Moscow: Subjected the Celtic defence to a torrid evening with Efe Ambrose toiling throughout the match. Unfortunate to leave Glasgow with nothing to show for his general forward play. An outstanding contribution.
CELTIC: Forster 7, Lustig 6, Wilson 7, Ambrose 6, Izaguirre 7, Mulgrew 7, Brown 7, Kayal 7, Commons 8, Samaras 7, Hooper 7. Subs: Matthews 6, Nouioui 6, Ledley 6.
SPARTAK MOSCOW: Pesiakov 7, Kirill Kombarov 7, Insaurralde 6, Suchy 7, Dmitri Kombarov 7, Rafael Carioca 7, Kallstrom 6, Jurado 6, Dzjuba 6, Ari 7, Emenike 9. Subs: McGeady 6.