(CNN) -- Barcelona survived a late onslaught from rivals Real Madrid to win their Spanish Cup quarterfinal tie 4-3 on aggregate and knock the holders out on Wednesday.
In a dramatic game at Barcelona's Camp Nou stadium, the hosts went 2-0 up thanks to goals from Pedro and Daniel Alves before strikes from Cristiano Ronaldo and Karim Benzema leveled the match at 2-2.
Real laid siege to their opponents' goal in the final stages, even after defender Sergio Ramos was sent off, but couldn't find the goal that would have taken them through.
Jose Mourinho's side complained bitterly to the referee after the match but the result is sure to intensify pressure on the Portuguese coach, who has been forced to deny press rumors he is set to leave the club in June.
"You sometimes score a goal without trying much for one, and we happened to fail to score from four or five of our chances," Mourinho said.
"It was easy to talk to my men during halftime. I had few things to change. Halftimes are short when your team isn't playing well; those ten minutes don't seem enough. I only needed one minute today because my team played very well in the first half. I told them to keep it up.
"Maybe Pep Guardiola congratulated us after winning last year's final because it was a clean match without any havoc. If you like I'll congratulate him for winning last week's match. I have no problem doing so. They deserved to win that game."
Real had the first chance of the match inside 15 seconds as a mistake from Gerard Pique let Gonzalo Higuain in on goal but the Argentina striker fired wide with only Barca keeper Jose Manuel Pinto to beat.
Higuain had another two chances to open the scoring but Pinto saved his close-range effort from Xabi Alonso's free kick, before blocking a shot after he had surrendered possession.
Germany international Mesut Ozil then struck the bar with a fierce shot from 35 yards with Pinto beaten, before Ronaldo drew another save from Barca's reserve keeper.
A melee ensued after Real midfielder Lassana Diarra brought down Argentina striker Lionel Messi and was fortunate not to receive a second yellow card.
Real were made to pay for their profligacy when Messi ran at Real's defense and teed up substitute Pedro to score shortly before the break, and just minutes later Brazilian fullback Alves made it two with a thunderous drive into the top corner.
In the second half Real came back at their opponents as Ronaldo rounded Pinto from Ozil's pass to make it 2-1 and when France international Benzema made it 2-2 with 18 minutes left Real sensed victory.
They continued to pour forward after Ramos was shown a second yellow card but couldn't find the vital third goal.
Barca's night was marred by an injury to Andres Iniesta, who has a suspected hamstring tear and was replaced by Pedro after half an hour.
His fellow Spain midfielder Xavi celebrated his 32nd birthday by equaling Joan Segarra's Barca record of 31 appearances in Clasico matches.
Barcelona will now face either Valencia or Levante in the semifinals. The pair play Thursday, with Valencia 4-1 up from the first leg.
In Wednesday's other tie, Athletic Bilbao sealed a clash with third division Mirandes in the final four after a 1-0 win at Mallorca sealed a 3-0 aggregate victory in an all-La Liga encounter.
In England, Liverpool booked a League Cup final date with second division Cardiff after beating Premier League leaders Manchester City 3-2 on aggregate at Anfield.
Trailing 1-0 from the first leg, Nigel De Jong brought City level on aggregate with a vicious long range drive before Steven Gerrard restored Liverpool's advantage from the penalty spot.
Striker Edin Dzeko put City back on terms when he tapped in Aleksandar Kolarov's cross on 62 minutes before Wales forward Craig Bellamy equalized against his former club to make it 2-2 on the night and secure a 3-2 aggregate win.
In Italy, two goals from Uruguay striker Edinson Cavani helped Napoli to knock out Italian Cup holders Inter Milan and reach the semifinals.
Napoli will next face Siena, who beat Chievo Verona 1-0 thanks to Mattia Destro's goal.