The Catalan giants were able to hang on to a slender aggregate lead to reach the final four of the cup, knocking out Jose Mourinho's brave men in what was an end-to-end encounter
Despite Real Madrid looking the better side for the majority of the first-half, the home side grabbed the lead in the 43rd minute when Pedro coolly slotted home after an excellent Lionel Messi run. The Catalans were in wonderland just before the halftime whistle when Dani Alves unleashed a stunning drive into the top corner of the net
Cristiano Ronaldo pulled a goal back in the 68th minute from time and four minutes later the visitors were level when Benzema slammed home. Yet it was not to be for the away side as it had Sergio Ramos sent off late on for a second yellow card as Barcelona held on for a place in the competition's semifinals where it will face either Valencia or Levante.
Madrid nearly made a dream start after only 12 seconds with the Barcelona defense clearly not on the same page. Dani Alves attempted to play the ball back to Gerard Pique, yet the former Manchester United man did not have his eyes on the play and allowed it to bypass him into the path of Gonzalo Higuain who blasted the ball wide from 12 yards out.
The visitors were impressive in the first quarter of the game and were within inches away of opening the scoring in the 25th minute. Mesut Ozil picked the ball up 30 yards from goal and unleashed a venomous drive which had the beating of Pinto before rebounding off the crossbar and post to safety.
However, for all of their endeavors, Los Blancos found themselves a goal down in the 43th minute after some Lionel Messi magic. The diminutive Argentine weaved his way past several Madrid players before playing a clever pass to the unmarked Pedro, an early substitute for the injured Andres Iniesta, who swept the ball home past a helpless Iker Casillas from 12 yards out.
Despite coming under pressure for the majority of the half, Barcelona grabbed a stunning second three minutes into injury-time. Xavi's free-kick deflected off the chest of Lassana Diarra and into the path of Dani Alves on the edge of the box who smashed an unstoppable shot into the top corner of the net to give his team a 4-1 aggregate lead at the break.
Mourinho's side thought it had pulled a goal back in the 53rd minute when Sergio Ramos slammed a header past Pinto from a Xabi Alonso set-piece yet the goal was disallowed by the referee as the former Sevilla man was adjudged to have tugged at Alves' shirt in the build-up.
There was to be a ray of light for the away side as it scored in the 68th minute to pull the scoreline back to 4-2 on aggregate. Ozil's precise through ball fell to the feet of Ronaldo who rounded Pinto before calmly sliding it into the empty net.
Four minutes later Madrid was level on the night when Gerard Pique's clearance was headed into the path of Karim Benzema by Xabi Alonso. The French striker who came on as a substitute then flicked the ball past Carles Puyol before slamming it home to set up a pulsating end to a superb encounter.
Both sides refused to sit back in the final stages as Madrid looked for the one goal it needed while, predictably, Barcelona used attack as the best form of defense. However, the scoreline stayed the same and Madrid had Ramos sent off in the 88th minute for a second yellow card for raising an arm to Sergio Busquets, as the Blaugrana squeezed through to the final four of the Copa del Rey.
Both sides return to Liga action at the weekend with Real Madrid entertaining Real Zaragoza on Saturday while Guardiola's side travels to Villarreal.