Bayern Munich became the first team to advance to a Champions League final it is hosting, beating Real Madrid 3-1 on penalty kicks Wednesday night as Bastian Schweinsteiger converted the final shot after Sergio Ramos skied his over the crossbar.

Bayern, a four-time champion of European soccer's top club tournament, reached the final for the second time in three seasons and will play Chelsea at Allianz Arena on May 19. Chelsea eliminated defending champion Barcelona on Tuesday.

Madrid's players left the field with their heads hanging low and some in tears.

"It's a big blow for us. It was a very exciting game, but penalties are always a lottery," Madrid goalkeeper Iker Casillas said. "We played well, but Bayern are a great team."

Following Bayern's 2-1 win in Germany last week, Real won the second leg 2-1 to force the shootout, the first in the semifinals since Liverpool defeated Chelsea in 2007.

Ronaldo converted a penalty kick in the sixth minute after a cross by Angel Di Maria went off a hand of sliding defender David Alaba. Ronaldo doubled the lead in the 14th from inside the penalty area from a pass by Mesut Oezil, his 56th goal of the season.

Arjen Robben evened the aggregate score in the series 3-3 and the away goals 1-1 in the 27th when Hungarian referee Victor Kassai awarded the penalty kick after Pepe pushed Mario Gomez.

The score stayed that way through the second half and 30 minutes of overtime.

In the shootout, Alaba beat Casillas with the first kick, and Bayern's Manuel Neuer saved Ronaldo's shot. Coming in, Ronaldo had converted 25 of 26 penalty kicks for Real Madrid. The only time he failed was when Almeria's Diego Alves saved him in a Spanish league match on Dec. 5, 2009, his first season in Madrid. Ronaldo also had a penalty saved by Chelsea's Petr Cech in the 2008 Champions League final.

Gomez converted his kick for a 2-0 lead, and Neuer stopped Kaka's shot. Casillas then denied Toni Kroos, Xabi Alonso scored for Madrid, and Casillas stopped Philipp Lahm.

Ramos sent his shot high over the bar — as if it were an NFL field goal — and Schweinsteiger put his shot straight down the middle as Casillas dived left, giving Bayern its fourth victory in five semifinal meetings with Madrid.

Real, in its second season under coach Jose Mourinho, has not reached the final since winning in 2002.