LONDON -Arsenal, AS Roma and Shakhtar Donetsk became the final three teams to reach the knockout stage of the Champions League on Wednesday.
Roma secured second place in Group E, behind Bayern Munich, by drawing 1-1 at Cluj. FC Basel came into the final matchday needing to beat Bayern to stand any chance of catching Roma but was thrashed 3-0 in Germany.
Group H had both qualifying spots open but Shakhtar finished top by winning 2-0 at home to FC Braga, and Arsenal joined the Ukrainian champions after a nervy 3-1 victory over Partizan Belgrade.
Chelsea's perfect record in Group F ended with a 1-0 loss at Marseille to increase the pressure on manager Carlo Ancelotti, while Real Madrid remained unbeaten after its six matches in Group G courtesy of a 4-0 win over Auxerre, with Karim Benzema scoring a hat trick.
The draw for the last 16 will be held on Dec. 17, with group winners and teams from the same country prevented from playing each other.
Roma only needed a point to go through, but looked as if it would pick up all three when Marco Borriello put the Italian side in the lead in the 21st minute from 12 yards.
Lacina Traore headed home in the 88th to earn the Romanian team a draw.
France winger Franck Ribery scored in both halves for Bayern, which was already assured of winning the group. Defensive midfielder Anatoliy Tymoshchuk also found the target for last season's runner-up.
Basel finished third and will play in the Europa League.
Arsenal reached the second round of the Champions League for the 11th straight year but was given a scare by Partizan and needed late goals by Theo Walcott and Samir Nasri to seal the win.
Robin van Persie, making his first start in the competition in more than a year, put the Gunners ahead from the penalty spot in the 30th after he was fouled by Marko Jovanovic.
But Arsene Wenger's side, which climbed to the top of the Premier League last weekend, was far from its best and conceded when Cordova Cleo's shot deflected off Sebastien Squillaci and over diving Arsenal goalkeeper Lukasz Fabianski in the 42nd.
"When it was 1-1, you never know," Wenger said. "Football is mysterious sometimes. They got a deflected goal, they hadn't had many chances and sometimes when it's all against you they can score a second goal."
Wenger sent on substitute Walcott and the England winger scored within six minutes, volleying home after collecting a poor defensive clearance.
Nasri wrapped the game up in the 77th, the in-form midfielder slamming in a left-footed shot from 15 yards for his 12th goal of the season.
Bacary Sagna was sent off in the 85th minute for a professional foul and will miss the first leg of the last 16.
When asked which side Arsenal would like next, Van Persie said: "As a football fan, Barcelona or Madrid, but we'll see what the draw will be."
The Gunners could also face German teams FC Schalke or Bayern.
Braga had to better Arsenal's result, or win 4-0 in Donetsk, to clinch a top-two finish but never threatened and conceded two goals in the final 11 minutes.
Madrid coach Jose Mourinho watched from the stands as his team finished Group G unbeaten.
Mourinho was serving a one-game ban for instructing Xabi Alonso and Sergio Ramos to deliberately incur red cards in a victory at Ajax two weeks ago.
Madrid had no problems without its coach's touchline prompts, Benzema opening the scoring in the 12th and adding two more goals in the final 18 minutes in his best display in 18 months with the club.
"Karim deserves this because he's been working very hard," said strike partner Cristiano Ronaldo, who scored in the 49th for his 21st goal of the season. "Things hadn't been working out but he answered very well."
The nine-time champions closed out its most successful Champions League group campaign with 16 points from a possible 18.
In the group's other match, Demy de Zeeuw and Toby Alderweireld scored second-half goals for Ajax in a 2-0 win over AC Milan to secure the Dutch side a spot in the Europa League.
In Group F, Brandao's 81st-minute goal gave Marseille a 1-0 win over Chelsea, ending the English club's bid to become only the fifth team to win all six matches in the group stage.
The Brazilian striker struck the winner by wrong-footing goalkeeper Petr Cech from close range after collecting a deflected shot from defender Taye Taiwo inside the area.
Chelsea has now won just two of its last eight matches in all competitions.
Zilina's home match against Spartak Moscow was interrupted for 20 minutes shortly after kickoff due to away fans throwing flares onto the field.
When play resumed, Tomas Majtan put the Slovak champions ahead in the 48th. But Alex equalized and then sent in a cross for Ibson — who was later sent off — to tap in a winner from close range seven minutes later.
Zilina and Partizan finished the group stage without a point.