WRAP: Champions League
London - APOEL Nicosia became the first Cypriot team to reach the Champions League last 16, Arsenal were the first English side through this season and Chelsea's woes increased when Bayer Leverkusen snatched late qualification on Wednesday.
Holders Barcelona, who had already sealed their progression, secured top spot in Group H with a 3-2 win at AC Milan where Lionel Messi scored from the spot but only after being cautioned for stopping in his run-up on his first attempt.
Manuel Friedrich's 90th-minute goal for Leverkusen took the Germans through with a 2-1 home triumph over faltering Chelsea, who now need to beat Valencia at home or draw 0-0 in the last match to go through.
Didier Drogba had handed the visitors the lead with a top-class goal just after the break but Eren Derdiyok's header with almost his first touch and Friedrich's winner out of the blue sent home fans and ex-Chelsea midfielder Michael Ballack wild.
"We thought we had the game in our hands at 1-0 because we were compact and solid," under pressure Chelsea boss Andre Villas-Boas, who has also lost three out of his last four Premier League matches, told Sky Sports.
"We are improving our work and determination but at the moment it is not sufficient."
Valencia warmed up for the final Group E clash with a 7-0 thumping of bottom side Racing Genk in which Roberto Soldado bagged a first-half hat-trick.
APOEL's 0-0 draw at Zenit St Petersburg, halted twice because of heavy smoke from flares, followed an onslaught from the Russians but the Cypriot champions clung on to complete a stunning achievement for the island nation.
"We have good players who try hard every single game and they also have a great desire to achieve something really important," APOEL's Serbian coach Ivan Jovanovic said.
"I think these factors have been the key to our success on the pitch."
APOEL remain the only unbeaten team in Group G where twice champions Porto won 2-0 at bottom side Shakhtar Donetsk to keep alive their hopes of overhauling second-placed Zenit when they meet in the final group game in Portugal on Dec. 6.
Goal machine Robin van Persie scored another brace in a 2-1 home victory over Borussia Dortmund as Arsenal finished top and did what Manchester United, Manchester City and Chelsea have so far failed to do and qualified for first knockout round.
Inconsistent Olympique Marseille were also going through from Group F until Giannis Fetfatzidis struck eight minutes from time to give Olympiakos Piraeus a 1-0 victory at the Stade Velodrome to rekindle their last-16 hopes.
Several permutations are possible for the second group berth but Marseille know a win at the surprisingly weak German champions in two weeks would put them through to the knockout stages starting in February.
Viktoria Plzen won 1-0 at Bate Borisov in the fog to boost their chances of finishing third and taking Group H's Europa League berth with Milan having already at least guaranteed second spot before the heavyweight clash with Barca.
A Mark van Bommel own goal against his former side gave the holders a 14th-minute advantage in the San Siro but Zlatan Ibrahimovic, also formerly of Barca, levelled soon after before the palaver of Messi's penalty.
A neat finish from Kevin-Prince Boateng after the break handed seven-times winners Milan parity only for Xavi to have the last laugh and make sure of first place.
Inter Milan, Bayern Munich and Benfica reached the last 16 on Tuesday while Manchester United slipped up and need a draw in their last match in Basel to progress. Premier League leaders Manchester City lost to Napoli and qualification is out of their hands
Results from Wednesday's UEFA Champions League matches (home team mentioned first):
Bayer Leverkusen 2 (Derdiyok 73, Friedrich 90+1) Chelsea 1 (Drogba 48)
Valencia 7 (Jonas 10, Soldado 13, 36, 39, Pablo Hernandez 68, Aduriz 70, Alberto Costa 81) RC Genk 0
Marseille 0 Olympiakos 1 (Fetfatzidis 82)
Arsenal 2 (van Persie 49, 86) Borussia Dortmund 1 (Kagawa 90+2)
Zenit Saint Petersburg 0 APOEL Nicosia 0
Shakhtar Donetsk 0 Porto 2 (Hulk 79, Rat 90-og)
AC Milan 2 (Ibrahimovic 20, Boateng 54) Barcelona 3 (van Bommel 14-og, Messi 31-pen, Xavi 63)
BATE Borisov 0 Viktoria Plzen 1 (Bakos 42)
Played on Tuesday:Group A:
Napoli 2 Manchester City 1
Bayern Munich 3 Villarreal 1Group B:
Trabzonspor 1 Inter Milan 1
CSKA Moscow 0 Lille 2Group C:
Otelul Galati 2 Basel 3
Manchester United 2 Benfica 2
Real Madrid 6 Dinamo Zagreb 2
Lyon 0 Ajax 0