Cristiano Ronaldo's injury-time penalty put holders Real Madrid through to the Champions League semi-finals after holding off a stunning Juventus comeback.
Ronaldo's coolly taken 97th-minute penalty into the top corner came after Medhi Benatia brought down Lucas Vazquez in the box.
Juve goalkeeper Gianluigi Buffon, in what might be his last Champions League appearance, was sent off by English referee Michael Oliver after awarding the spot-kick, for foul and abusive language.
Real, Champions League winners in three of the past four seasons, came into the second leg leading 3-0, helped by Ronaldo's stunning bicycle kick.
But the Serie A leaders got off to a perfect start when Mario Mandzukic headed in from Sami Khedira's cross after just two minutes and Mandzukic got a second before half-time.
Blaise Matuidi pounced to capitalise on Keylor Navas' fumble to level the tie on aggregate before the dramatic ending.
Real join Liverpool, Roma and Bayern Munich in the last-four draw, which takes place in Nyon on Friday at 12:00 BST.
- Football Daily podcast: ‘Lucky’ Real Madrid and ‘disgraceful’ Buffon
- Bedlam at the Bernabeu - reaction to Real's dramatic win
- Relive how it happened
Chaotic 10 minutes in Madrid
The game looked to be heading for extra time before a chaotic final few minutes saw even the calmest of players lose control.
- 90th minute: Benatia push on Vazquez is adjudged to be a foul and Oliver points to the spot. Benatia booked and furious Juve players surround the referee, incensed at the decision.
- 93rd minute: Buffon remonstrates too vociferously, screaming and pointing his finger in the direction of Oliver and is shown a red card.
- 96th minute: Juve striker Gonzalo Higuain is brought off and replaced by former Arsenal goalkeeper Wojciech Szczesny.
- 97th minute: Ronaldo despatches the penalty into the top right-hand corner.
- 98th minute: Ronaldo is booked for taking off his shirt while celebrating in front of the home supporters.
- 99th minute: Referee blows for full-time.
Ronaldo steps up to the mark
Real have endured a poor season so far in La Liga, sitting fourth in the table and 15 points adrift of runaway leaders Barca, who capitulated on Tuesday night to go out of the Champions League.
The competition is Real's only hope of a major trophy this season, but they only just managed to sneak through to the last four for the eighth consecutive season.
Ronaldo, the Ballon d'Or holder, proved himself to be the best once again, stepping up under the most intense pressure to send his team through.
The penalty extended his incredible goalscoring form this campaign:
- Now netted in 11 games in a row for Real
- Takes his tally to 27 in his past 14 games for club and country
- 41 strikes overall in 38 games this season
- 120th goal in 150 Champions League appearances.
Not the send-off Buffon was hoping for
Legendary goalkeeper Buffon ended the night, and possibly his European career, in controversial fashion.
It drew parallels with Real boss Zinedine Zidane when his France playing career ended with a sending off at the 2006 World Cup final for a headbutt on Italy defender Marco Materazzi.
Italy's most-capped international Buffon, who is much respected throughout the game, let his emotions overcome him at the end and was dismissed on his 650th appearance for Juve.
Buffon had announced in October that this would be his last Champions League campaign unless his side won the final, after which he had intended to play in the Club World Cup.
Buffon had been having a brilliant game, saving low from Welshman Gareth Bale and reacting sharply to keep out efforts from Isco and Ronaldo.
But he will not receive the dream send-off, missing out on claiming the only major trophy which has evaded him in his career.
Super Mario - the stats
- Cristiano Ronaldo has scored 10 Champions League goals against Juventus - the most by one player against a one opponent in the competition.
- Juventus have won more away games against Real Madrid than any other side in all European competition [three].
- Gianluigi Buffon's first Champions League red card was Juventus' sixth in the competition against Real Madrid - more than any team has had against another opponent in the competition.
- Mario Mandzukic's first goal after 76 seconds was the fastest that Real Madrid have ever conceded in a Champions League home game.
- Mandzukic also became the first player to score a first-half double as an opposition player in a Champions League match at the Bernabeu.
- The Italian side had more shots on target in the opening 15 minutes of play [three] than they did in the entire first leg (2).
Real MadridJuventus
- Possession
- 62%
- 38%
- Shots
- 18
- 11
- Shots on Target
- 6
- 6
- Corners
- 7
- 3
- Fouls
- 8
- 20