The Blaugrana took the lead against the run of play after Eder Militao turned a loose ball into his own net after a careless back pass from Eduardo Camavinga.
Barcelona were happy to absorb pressure for the remainder of proceedings, with Europe's best defence leaving Madrid frustrated.
It was a remarkable showing from the Blaugrana midfield and back-line, blanking a team that has developed a reputation for being deadly in knockout football.
Article continues below
Still, a 1-0 lead could yet be precarious as the two teams meet for the second leg in a few weeks time.
GOAL rates Barcelona's players from Santiago Bernabeu...