Leipzig - A late strike from Talisca saw RB Leipzig end their first Champions League campaign with a bitter 2-1 defeat at home to Besiktas on Wednesday night.
Porto's comprehensive 5-2 victory over Monaco in the other Group G game meant that even a win would not have been enough for Leipzig to progress from the group stage.
With their Champions League exit beyond doubt, Leipzig appeared to have salvaged some pride by coming from behind to level against group winners Besiktas thanks to a Naby Keita strike three minutes from time.
But Talisca's 90th-minute effort snatched victory for the Turkish side.
Spanish striker Alvaro Negredo's ninth-minute penalty had given Besiktas the lead after Willi Orban was penalised for a reckless challenge on Jeremain Lens.
"I can't remember a game in which we had so many chances," said Leipzig coach Ralph Hasenhuettl. "The penalty was a bad start, but the team showed great morale."
With Porto running riot at home to Monaco, Leipzig were never really in with a chance of leapfrogging the Portuguese side to take second place.
The Bundesliga outfit did respond well, and Orban could have made amends for the penalty when a loose ball fell to him in front of the Besiktas goal on 15 minutes.
However, he dragged his shot onto the post, while Timo Werner and Bruma both forced smart saves from Tolga Zengin later in the first half.
Werner was ruled offside after finding the net on 21 minutes, before the referee waved away an optimistic penalty appeal from Jean-Kevin Augustin.
ILSANKER SENT OFF
Zengin continued to frustrate Leipzig after the break, making five saves before the hour mark to keep his team's lead intact.
Augustin scored from an offside position on 65 minutes, and Stefan Ilsanker headed over the bar from close range as Leipzig continued to push for the equaliser.
The introduction of Dominik Kaiser lifted the home side again with 15 minutes to go.
Having joined Leipzig when they were still in the fourth tier of German football, Kaiser was given a roaring reception as he made his Champions League debut.
Boosted by his arrival, Leipzig bore down on goal again, with Bruma forcing another flying save from Zengin.
Leipzig continued to fight even after they were reduced to 10 men on 82 minutes, Ilsanker seeing a second yellow card for a cynical tug on Cenk Tosun.
Zengin would finally be beaten when Keita broke through the defence in the 87th minute, lofting the ball over the Besiktas goalkeeper to level the scores.
The consolation was short-lived, however, as the ball fell to Talisca at a Besiktas corner, and the Brazilian swept the ball into the top corner to restore the lead.
Having finished third in Group G above Monaco, Leipzig's first season in European competition will continue in the Europa League in the new year.
"We had so many chances, but it wasn't to be," said Orban. "The goalkeeper had the game of his life. It's a shame that we lost, but we are still in European competition."