Real Madrid's Cristiano Ronaldo scores a penalty against Juventus in the second leg of the two sides' semi-final match-up.
CNN  — 

Last year’s Champions League finalist Juventus is out of the competition despite a spirited 3-1 second leg win against Real Madrid Wednesday.

The Italian giant came agonizingly close to overturning Real Madrid’s three-goal first leg lead in the Spanish capital, but instead went down to a late penalty.

It undid 98 minutes of work by a hard-running, passionate Juve. The Italian club was indebted to striker Mario Mandzukic, who put the team ahead almost as soon as the match had started with a powerful header, before replicating the feat 35 minutes later.

The second leg of the match-up, a retread of the 2017 final, had looked a mountain to climb for Juve after Real’s 3-0 thrashing of the Italian league leaders in Turin last week.

But as the match wore on, an upset similar in scope to Roma’s feats on Tuesday night against Barcelona suddenly looked a possibility, when Blaise Matuidi capitalized on a goalmouth fumble, poking home from short range to spark hope among the traveling fans.

Juventus midfielder Blaise Matuidi celebrates his goal -- Juventus' third of the night -- during the tie.

Tuesday’s match at the Stadio Olimpico had seen an Italian team complete a three-goal comeback and seal its place in the last four of the tournament at the expense of a Spanish side, but ultimately the Bianconeri couldn’t match the Romans’ feat.

Late heartbreak

As injury time ticked away and the possibility of another thrilling comeback looked tantalizingly close, Real’s Lucas Vazquez was adjudged to have gone down under pressure in the box.

The award of the late spot kick sparked long-time Juve goalkeeper and club talisman Gianluigi Buffon to unleash a torrent of invective against referee Michael Oliver, who duly showed the Italian a red.

Juventus goalkeeper Buffon  argues with referee Michael Oliver following the award of a penalty to Real Madrid.

The penalty’s subsequent conversion by Real’s Cristiano Ronaldo – who, playing in his 150th Champions League game, scored his tenth against the Italian side – in the 98th minute was enough to see the Spanish giants through to the last round with an aggregate score of 4-3.

Bayern progresses

Elsewhere, it was a more routine affair with Bayern Munich holding Spanish side Sevilla to a goalless draw in the Bavarian city, to advance with a 2-1 aggregate score over the two legs.

The German team, which sealed the Bundesliga title at the weekend, are through to a sixth Champions League semi-final in seven seasons.

The night caps off a helter-skelter quarter-final round of the competition, which saw Roma advance at the expense of perennial favorites Barcelona in a thrilling three-goal comeback, while English side Liverpool put runaway Premier League leaders Manchester City to the sword.

Friday will see the semi-final draw, where Bayern, Roma, Real Madrid and Liverpool will learn their opponents for the two-leg semi-finals, which commence at the end of April, with the return legs scheduled for the beginning of May.