Bayern Munich goalkeeper Sven Ulreich committed a huge blunder as holders Real Madrid edged into the Champions League final.
Ulreich missed a backpass to gift a vital second goal to Karim Benzema at the Santiago Bernabeu, and the Frenchman's double in a pulsating 2-2 draw ensured Real progressed 4-3 on aggregate.
Bayern had led early through Joshua Kimmich and a strike from James Rodriguez - who is on loan at the German club from Real - set up a tense finish.
However, the hosts withstood considerable pressure to keep their bid for a third successive title on track.
The defending champions will now play either Liverpool or Roma in the final in Kiev on May 26.
Defeat was harsh on Bayern, who dominated large spells of the game.
Knowing they needed to score at least twice, the Germans went straight on the attack and set the tie alight as they snatched the lead after just three minutes.
Franck Ribery sent the ball out wide and Corentin Tolisso whipped in a cross from the right. Sergio Ramos should have dealt with it but failed to clear and Kimmich pounced from close range.
Real responded quickly and Cristiano Ronaldo went close to levelling as he fired wide from six yards.
The equaliser came after 11 minutes as Mateo Kovacic spread play and Marcelo delivered a superb cross to the back post, picking out an unmarked Benzema, who rose highest to power home a header.
The visitors spurned a gilt-edged opportunity just after the half-hour mark as Rodriguez volleyed over in front of goal after Keylor Navas saved from Robert Lewandowski.
Ulreich's gaffe handed Real the lead in the first minute of the second half.
Tolisso's backpass was poorly hit but Ulreich, realising too late he could not handle, completely missed the ball and Benzema stole in for his second.
Navas did well to save a powerful shot from David Alaba which took a wicked deflection. Mats Hummels and Niklas Sule were also thwarted.
Ronaldo side-footed over from six yards but the German side regained control and levelled on the night as Rodriguez struck at the second attempt after his initial shot was blocked by Raphael Varane.
Tolisso forced a save from Navas before Rodriguez had another effort blocked as Bayern sought a clinching goal.
They pressed to the end, forcing Real into a rearguard action, but could not find a way through.
Real Madrid win 4-3 on aggregate
REAL: Navas, Lucas, Varane, Sergio Ramos, Marcelo, Asensio (Nacho, 87 mins), Kovacic (Casemiro, 72 mins), Modric, Kroos, Benzema (Bale, 72 mins), Ronaldo. Unused subs: Casilla, Hernandez, Borja Mayoral, Ceballos.
Bayern: Ulreich, Kimmich, Hummels, Sule, Alaba, Tolisso (Wagner, 75 mins), Thiago, Muller, Rodriguez (Javi Martinez, 83 mins), Ribery, Lewandowski. Unused subs: Starke, Rafinha, Lukas, Rudy, Dorsch.
Referee: Cuneyt Cakir (Turkey)
Man of the match: Karim Benzema
Match rating: 8/10