The Catalan club came out on top in a breathtaking 90 minutes against the Italian champions, with Xavi grabbing two goals to give his side an unassailable lead in Group H.Barcelona edged AC Milan 3-2 at the San Siro in the Champions League on Wednesday to guarantee top spot in Group H.
Mark van Bommel's own goal and strikes from Lionel Messi and Xavi gave the reigning European champs the win. Zlatan Ibrahimovic and Kevin-Prince Boateng scored for Milan.
The Catalan club took the lead in the 14th minute through Bommel before Ibrahimovic equalized seven minutes later. Messi's penalty gave the visitors the lead at the break before a wonderful goal from Boateng on 54 minutes leveled the scoring once again.
However, Xavi popped up to score what proved to be the winning goal in the 63rd minute.
Barcelona sits at the top of the group on 13 points while Milan is five points behind last season's Champions League winners, with both teams having one game each to play.
After an uneventful opening period, Barcelona took the lead on 14 minutes with the first real attack of the game. Messi's clever ball found Seydou Keita in space inside the box before the Malian played a low cross which was bundled into his own net by Van Bommel, via a touch from Xavi.
Milan should have equalized in the 19th minute but Robinho was guilty of a shocking miss. Ibrahimovic's cross into the box was then drilled into the direction of the unmarked Brazilian forward by Boateng who smashed it over the crossbar from close range.
However, the home team was level two minutes later, taking advantage of some slack Barcelona defending. Clarence Seedorf's clever pass bypassed the visitor's defense as Ibrahimovic was allowed to slot the ball home from 10 yards out.
Pep Guardiola's men had a glorious chance to retake the lead on 23 minutes but it was Messi's turn to miss a glaring opportunity. Cesc Fabregas did well to work some space on the right side of the penalty area before sliding the ball to the Argentine who struck the top of the bar from three yards out.
Barcelona was awarded a penalty on the half-hour mark when Alberto Aquilani was guilty of pulling down Messi in the box. The forward stepped up to put the ball in the far corner, beyond the outstretched hand of Christian Abbiati - the second time Messi had found the back of the net in a minute after the referee ordered a retake.
The away team made the brighter start in the second period but Milan found itself level again on 54 minutes through a moment of brilliance from Boateng. The Ghanaian international seized on a loose ball on the edge of the box before sending Eric Abidal the wrong way with a clever touch using his heel. Faced one on one with Victor Valdes, the midfielder slammed the ball low past the goalkeeper from 12 yards out.
For the third time in the game, Guardiola's side was back in front on 63 minutes with another beautifully taken goal. Fabregas and Messi linked up well before the Argentine slid a precise throughball to Xavi, who calmly placed the ball into the bottom corner in what proved to be the winning goal of the game.
Both sides end their respective group stage campaigns on Dec. 6 when Barcelona entertains BATE Borisov while Milan travels to Viktoria Plzen.