Two goals by Igor De Camargo were enough to send Borussia Monchengladbach through to the knockout stage of the Europa League as they finally ground out a 2-0 victory against 10-man AEL.
The Bundesliga side started the game level on points with Marseille, who lost 1-0 to Group C leaders Fenerbahce, with victory all but essential.
However, they were stifled by their visitors who had no chance of qualifying and it was not until the sending off of Aderito Dede 13 minutes from time that the game tipped towards Monchengladbach.
Substitute De Camargo put them ahead two minutes later and sealed victory in injury time and although they can still finish with the same points as Marseille, their head-to-head record is superior and sees them through.
It was not until the 20th minute that the Bundesliga side had an effort on target, Alexander Ring firing over with Mike Hanke then drawing a comfortable save from Matias Degra in the visitors' goal.
The AEL keeper was not unduly tested by Juan Arango's free-kick but Monchengladbach came closest to making the breakthrough in the final minute of the first half, Degra blocking Ring's right-footed volley.
The second half started in much the same vein, the Germans enjoying the greater possession but producing little in the area it mattered most.
It took them 10 minutes to have a shot, Arango firing over the bar before home keeper Marc ter Stegen comfortably saved from Lacerda Edmar as the visitors produced a rare shot.
Alvaro Dominguez headed over before moments later trying his luck again but shooting wide and it was hard to see how the breakthrough would come about despite the urgent nature of the game.
However, their task was seemingly made a little easier when their opponents were reduced to 10 men with 13 minutes remaining when Dede was sent off for serious foul play.
And Monchengladbach took almost immediate advantage, Havard Nordtveit finding De Camargo on the right side of the area and the substitute sent a low shot into the bottom left-hand corner of the goal.
The substitute then made certain of the win - and Monchengladbach's qualification - when he headed home Herrmann's cross in injury time.