Cristiano Ronaldo showed nerves of steel to score an injury-time penalty and send holders Real Madrid into the semi-finals of the Champions League in dramatic circumstances as they lost 3-1 to Juventus on Wednesday but won a thrilling tie 4-3 on aggregate.
Juventus looked to have staged a stunning revival at the Santiago Bernabeu to force extra time after Mario Mandzukic scored twice in the first half and Blaise Matuidi added a third on the hour mark after a goalkeeping clanger from Real's Keylor Navas.
The goals cancelled out Real's resounding 3-0 win in Turin a week earlier but Lucas Vazquez won a disputed injury-time penalty and Juventus goalkeeper and captain Gianluigi Buffon was given a straight red card for pushing English referee Michael Oliver as he vented his fury at the decision.
The Italian veteran, who is set to leave Juventus at the end of the season, was given a standing ovation from the home fans as he walked off the pitch in what is likely to be his last act in a long and eventful career in the Champions League.
Juve's substitute goalkeeper Wojciech Szczesny came on but Ronaldo blasted into the top corner in the eighth minute of stoppage time to score for the 10th game running in this season's competition, sending Real into the semi-finals for a record-extending eighth year in a row.
Real were missing influential captain Sergio Ramos through suspension and Mandzukic headed Juventus in front when the game was only 76 seconds old, meeting a sumptuous cross from former Madrid midfielder Sami Khedira.
The early strike offered the visitors hope of repeating compatriots AS Roma's incredible second-leg turnaround against Barcelona the previous night and the Croatian struck again in the 37th minute, heading beyond Navas, who got a hand to the shot but could not prevent it going in.
Real had plenty of chances in the first half but Buffon made three strong saves to thwart Gareth Bale, Ronaldo and Isco, who was also denied a goal by the offside flag while Raphael Varane sent a header crashing against the bar from a free kick at the end of the half.
Real settled down after the interval, taming the visitors and twice firing at Buffon but down the other end Navas spilled a cross from Douglas Costa right at the feet of Matuidi who rolled the ball in to level the tie.
Madrid soon woke up and produced their best spell of the game as Isco, Varane and Ronaldo all went close while Giorgio Chiellini narrowly avoided scoring an own goal.
Ronaldo finally got the vital goal they had craved to pile more misery on the Italians, who were beaten 4-1 by Madrid in last season's final in Cardiff.