Ajax, who are left to battle it out with Apoel Nicosia in Group F for third spot and a place in the Europa League, finished with 10 men against Barcelona after defender Joel Veltman was sent off for two yellow cards.

Wednesday's Champions League facts

Barcelona's Xavi played his 144th Champions League game, going level with Real Madrid goalkeeper Iker Casillas with the most appearances

Bayern Munich have scored 11 goals in four Champions League Group E games, conceding one, while taking a maximum 12 points

Ajax's starting line-up had a combined total of 102 Champions League games - 42 less than Xavi has on his own

Only four of the Lionel Messi's 71 Champions League goals have been headers

Elsewhere in Group F, Uruguay international striker Edinson Cavani found the net in the first minute as leaders Paris St-Germain overcame Apoel Nicosia 1-0 to advance.

Goals by Franck Ribery and Mario Gotze ensured Bayern Munich overcame Roma 2-0 to win Group E with two games to spare.

The Italians, who began the match with Francesco Totti, Gervinho and Miralem Pjanic on the bench, will be fighting with CSKA Moscow and Manchester City for second spot.

"I'd like to congratulate my players. I never expected to qualify after four games," said Bayern manager Pep Guardiola.

However, Bayern's victory came at a cost as left-back David Alaba injured medial knee ligaments and Guardiola expects him to miss the rest of the calendar year.

Nani, who is on loan from Manchester United, scored one as Chelsea's Group G rivals Sporting Lisbon defeated Roberto Di Matteo's Schalke 4-2.

Sporting's Portuguese rivals Porto overcame Athletic Bilbao 2-0 to seal their place in the last 16, Jackson Martinez and Yacine Brahimi with the goals.

Also in Group H, Shakhtar Donetsk defeated BATE Borisov 5-0, Brazilian striker Luiz Adriano scoring a hat-trick to take his tally in this season's competition to nine goals in four appearances.