First blood to Barca against Real in Cup
Second half goals from veteran defenders Carles Puyol and Eric Abidal overturned a half-time Madrid lead for whom Portuguese star Cristiano Ronaldo scored.
It was the third victory in twelve months for the Catalans in the stadium of their biggest rival.
Unless Real can produce something special in the second leg in the Nou Camp in a week's time it could become a season defining result with both teams also battling for supremacy in La Liga and the Champions League.
Pep Guardiola is yet to lose in the Bernabeu in four seasons in charge and his team appear to have a psychological advantage over 'los blancos'.
Madrid coach Jose Mourinho surprised all with an unfamiliar side employing both Karim Benzema and Gonzalo Higuain in attack, while at the back playing the rarely used Hamit Altintop and Ricardo Carvalho who was playing his first game since September.
Both teams started very cautiously with Madrid happy to allow Barca possession in deep positions and when the first attack came on 11 minutes it was to bring the first goal of the evening.
Set free by Benzema, Ronaldo produced a stinging left footed drive from the left hand side of the penalty area that Jose Pinto, Barca's regular goalkeeper ahead of Victor Valdes in the Spanish Cup, could perhaps have dealt better with.
The game suddenly burst into life, Andres Iniesta brought a save from Iker Casillas with a long range shot on 13 minutes and three minutes later Cesc Fabregas found Alexis Sanchez in space only for the Chilean to head onto the bar with Casillas stranded.
At the other end Abidal had to make a last ditch block to stop Ronaldo reaching Benzema with the goal at his mercy, then Lionel Messi burst forward for Barca and forced a near post save from Casillas.
Iniesta should have tested Casillas on 30 minutes from close range after Sanchez played him into a great position.
By this stage Barcelona were possessing the ball in deeper positions and Madrid were counter attacking quickly on the break to make the game an open affair.
Barca were finally level three minutes into the second period when captain Puyol got free from his marker Pepe to head home a Xavi corner.
Iniesta went close again on 54 minutes after a quick exchange of passes with Xavi and two minutes later Benzema hit the post for Madrid when found with a sweeping right wing cross from Altintop.
By the hour mark Barca's short passing game was allowing them to control the tie and Mourinho made some changes introducing Jose Callejon and Mesut Ozil.
Pepe should have seen his second yellow card of the night for an off the ball stamp on the hand of a prostrate Messi on 69 minutes.
However it took more than the dark arts to keep down the irrepressible Argentinian and it was he that conjured up the pass on 77 minutes that found Abidal onside and with the time and space to prod the ball home to win the tie.
A familiar silence came down over the Santiago Bernabeu, the home fans had seen it all before and although Madrid tried sporadically for a way back into the game Barca rarely ceded them the ball.
Related Barcelona News