(CNN) -- Ten-man Ajax beat Barcelona 2-1 at the Amsterdam Arena in the Champions League on Tuesday evening to hand the Catalans their first defeat under coach Gerardo Martino.
Thulani Serero put Ajax in front in the 19th minute before Danny Hoesen doubled the lead three minutes before halftime.
Barcelona were back in the game three minutes after the break when Joel Veltman was shown a red card for bringing down Neymar inside the penalty area. Xavi converting the spot kick but the home side held on for a vital win.
"We played a good match," Ajax coach Frank de Boer said afterwards.
"They are not used to being under so much pressure as we created in the first-half, nor a team that builds from the back," he added.
"We deserved to be 2-0 ahead at half-time. The (penalty) decision was key because it is a red card and a goal, but we fought hard."
Barcelona had already qualified for the knockout stages but will need a win in their final match against Celtic at the Nou Camp to guarantee top spot in the group.
In the other Group H match, Scottish champions Celtic had a disappointing night at Celtic Park going down 3-0 to AC Milan.
Goals from Kaka, Cristian Zapata and Mario Balotelli means that Milan remain in second with nine points but Ajax are now one point behind on eight and will qualify if they can beat the Rossoneri at the San Siro in the final round of Group H matches on December 11.
In Group F, Arsenal took a big step towards the knockout stages with a 2-0 win over Marseille at the Emirates Stadium.
Two goals from Jack Wilshere in the first minute and 65th minute mean the current English Premier League leaders are on 12 points and only need to draw their final group match against Napoli to qualify top of the group.
Last year's beaten finalists Borussia Dortmund kept their hopes of qualification alive with a 3-1 win against Napoli at Signal Iduna Park.
Jurgen Klopp's team, who are now level on nine points with Rafa Benitez's side, will travel to Marseille in their final qualifying match.
Meanwhile in Group E, Basel have a 100% record against Chelsea in Group E after snatching a late winner at St Jakob Park.
Mohamed Salah's 87th minute strike means the Swiss champions leapfrog Schalke into second with eight points, one point behind Chelsea who, despite the loss, have qualified for the knockout stages.
Schalke's 0-0 draw with Steaua Bucharest on Tuesday leaves them on seven points meaning that the German side need to beat Basel in their final match to qualify for the last 16.
In Group G, Atletico Madrid and Zenit St Petersburg drew 1-1.
The Spanish side, who had a 100% record in the group before Tuesday's tie at the Petrovsky Stadium, took the lead with an Adrian Lopez goal in the 54th minute but a goalkeeping error by Thibaut Courtois 20 minutes later proved costly.
The Belgian keeper misjudged a deflected cross from Igor Smolnikov which looped into the net to hand Zenit a vital point in their quest to qualify second in the group.
Porto could only draw 1-1 with Austria Wien. The result leaves the Portuguese champions in third with five points and means they will have to get something out of their trip to Atletico on December 11 to stand any chance of qualifying.