AC Milan kept up the pressure on Serie A leaders Lazio with a hard-earned 3-2 win away to Bari as Massimo Ambrosini, Mathieu Flamini and Alexandre Pato got the goals.
But Milan were made to fight for the three points as Vitaly Kutuzov and Paulo Vito Barreto scored for Bari.
Milan took the lead with four minutes gone as Ambrosini scored with a diving header from six yards from Clarence Seedorf's cross.
Robinho could have extended Milan's lead but he shot straight at the body of goalkeeper Jean-Francois Gillet from close range.
But just after the half-hour Flamini did add to Milan's score as he fired low into the goal from 20 yards following a pass by Zlatan Ibrahimovic.
Bari's first real chance of the game came four minutes before half-time but Nico Pulzetti's shot from 30 yards did not really test Christian Abbiati.
Pulzetti again tried a shot from distance but Abbiati saved to his left.
Robinho had the first opening of the second half for Milan but he lobbed the ball high and wide with only Gillet to beat.
Bari were back in the game when Kutuzov beat defender Mario Yepes and then shot low past Abbiati from inside the penalty area.
Pato restored Milan's two-goal advantage when he fired into the bottom right corner following a pass from Ronaldinho.
The same players teamed up again but the ball was cleared before Pato could finish off the chance.
Pato then tested Gillet with a shot from 25 yards before Barreto volleyed Bari's second goal to give the visitors an anxious final few minutes, but they held on to move to within two points of leaders Lazio.