The holders, who had scored in their previous 29 games in the competition, found no way through a Milan side that made up in organisation and doggedness what they lacked in ambition.
Massimo Ambrosini, in for Mark van Bommel, was relentlessly heroic in the centre of midfield, while Luca Antonini pulled off a remarkable goal-saving block from Cristian Tello.
Barcelona should have had a first-half penalty for a foul on Alexis Sanchez, while Robinho squandered Milan's best chance in the third minute.
Pep Guardiola's side will be favourites to progress at the Camp Nou next Tuesday, but Milan know that as long as they avoid defeat, the worst outcome is a penalty shootout, while any score draw will take them through.
But they may yet regret Robinho's shocking miss early on. Kevin-Prince Boateng's shot ricocheted up in the air, Zlatan Ibrahimovic headed it across goal and Robinho side-footed his volley high over the bar under no pressure.
Barcelona started to control possession, passing the ball intricately around. Milan, playing with an extraordinarily narrow formation, seemed content to block up the middle of the pitch and let the awful playing surface thwart Barca in wide areas.
When Barca did manage to thread the ball through, they were denied what looked a clear penalty. A superbly slick passing move found Alexis Sanchez, who knocked the ball past Christian Abbiati and was brought down by the goalkeeper.
It was an obvious foul, even if Sanchez was not going to retrieve the ball, but referee Jonas Eriksson was lenient on Milan.
Two minutes later, Lionel Messi had the ball in the net, but the goal was rightly chalked off for offside from Dani Alves's low cross.
Milan hit back against the run of play, as Clarence Seedorf caught Gerard Pique cold and slid a through-ball to Ibrahimovic, whose low, left-foot shot was smothered by Victor Valdes. It was the sort of chance the Swede might well have rifled into the net in a Serie A match.
Normal service was quickly resumed in a two-minute spell of possession for Barcelona, which culminated in a low Xavi shot that Abbiati did well to push away.
Then, just after the half-hour mark, Sanchez raced clear through the middle, only to be caught by a lung-busting effort from Antonini, who blocked the Chilean's shot.
All the while, Ambrosini kept plugging away in midfield, hassling, jockeying and nicking the ball away with utter defiance.
The Milan skipper made a fine block to deny Messi on 77 minutes, before Antonini's staggeringly brilliant intervention three minutes from time.
Abbiati could not hold Messi's shot, and as Tello swooped in to score an open goal, the flying Antonini somehow blocked the shot and celebrated like he had scored the winner.
Carles Puyol might have scored a diving header from a Xavi corner, but glanced his effort wide - and referee Eriksson chose to ignore some shirt-pulling from Djamel Mesbah.
Massimiliano Allegri's side might have been largely outplayed at home, and face an even greater challenge if they are to reach the semi-finals, but it is they who will take all the satisfaction from this result.