MADRID (AP) — Last time, it was a late penalty. This time, a goalkeeping blunder.

Real Madrid keeps finding ways to get out of trouble in the Champions League.

Madrid conceded early again at home and barely held on for a draw 2-2 against Bayern in Tuesday's semifinal match, advancing 4-3 on aggregate to stay on track for a third consecutive European title. But with Cristiano Ronaldo held scoreless for the second time in as many games, Madrid needed a blunder from Bayern goalkeeper Sven Ulreich to gift them their second — and crucial — goal on the night.

"It's a Champions League semifinal. You will always suffer," Madrid coach Zinedine Zidane said. "Nothing is easy. Football is like that, you have to suffer. And when you win, it feels even better, although it's not too good for your heart."

Joshua Kimmich scored for Bayern in the third minute to set the stage for another comeback at the Santiago Bernabeu, like the one Juventus nearly pulled off in the quarterfinals before Ronaldo converted an injury-time penalty.

But the hosts reacted quicker this time, with Karim Benzema equalizing early in the first half and scoring again just after halftime after an embarrassing mistake by Ulreich when he allowed a back pass into the area to go underneath him.

Bayern went within a goal of eliminating the European champions when former Madrid player James Rodriguez scored in the 63rd, and it pressured the hosts until the end, but it was not enough to avoid a third straight elimination against the Spanish club.

"We were the best team in both games but we were not able to reach the final," Bayern coach Jupp Heynckes said. "We dominated. They should thank (goalkeeper Keylor) Navas for his performance, especially toward the end of the match."

The German club, which has now been knocked out in the Champions League semifinals in four of the last five seasons, had several good chances in the final minutes but was unable to capitalize.

By successfully defending its 2-1 win from last week, Madrid stayed on track for a third consecutive European title, and fourth in five seasons.

Europe's most successful club with 12 trophies, Madrid will play the final against either Liverpool or Roma, which were playing Wednesday in Italy. Liverpool won the first leg 5-2 at home.

"It was a crazy match," Zidane said. "We struggled in the beginning, conceding early and not being able to play our game. But it was a lot better in the second half. We pressed up front and got the second goal."

Bayern started well and easily created scoring chances, while Madrid tried to control possession but only threatened on counterattacks with the speed of Ronaldo and Marco Asensio up front.

Kimmich netted from inside the area after Madrid captain Sergio Ramos failed to clear a ball crossed into the area by Corentin Tolisso.

It was an eerily similar start to Madrid's match against Juventus, when it conceded in the second minute while trying to protect a 3-0 first-leg advantage. Madrid conceded twice more in that game but eventually advanced thanks to Ronaldo's injury-time penalty.

This time, Madrid reacted a lot more quickly, with Benzema equalizing in the 11th with a firm header after a well-placed cross from the left by Marcelo.

Benzema hasn't been playing regularly as a starter and was a surprise addition to the lineup by Zidane. He had scored only once in his last 12 appearances in all competitions.

"It was a perfect night for me and for everyone," Benzema said.

The French striker gave Madrid a 2-1 lead after Ulreich's howler. The goalkeeper appeared to lose his footing while trying to get to the ball and seemed to hesitate to stop it with his hands before missing it entirely as he went to the ground. That allowed Benzema to run onto the ball for an easy finish into an open net.

"It was tough to concede that goal so early in the second half," Heynckes said. "It was a gift."

Bayern wasn't done yet and Rodriguez equalized with a low shot from inside the area. The Colombian playmaker didn't celebrate, instead raising his hands in an almost apologetic gesture to the home fans.

Bayern unsuccessfully appealed for a handball by Marcelo just before halftime, when the Madrid defender appeared to be just inside the area.

"I'd be lying if I said the ball didn't touch my hand," the Brazilian left back said. "And if it touched my hand, I think it was (a penalty)."

Meanwhile Robert Lewandowski continued to struggle up front, as he went a fifth straight Champions League game without a goal for the first time in his career.

Madrid, playing in its 250th Champions League match, is the first team to make it to three European finals in a row since Juventus from 1996-98.