Bayern Munich earned a dramatic victory at the Bernabeu on Wednesday, defeating Real Madrid, 3-1, in penalty kicks to advance to the Champions League final despite losing the second leg, 2-1.

Cristiano Ronaldo got Real Madrid off to a dream start in the affair, scoring twice inside the opening 15 minutes. But Bayern Munich leveled the aggregate score at three goals apiece when Arjen Robben converted a penalty kick in the 27th minute.

With both teams claiming an away goal in the 3-3 aggregate score, penalty kicks were needed to determine a winner, and the Bavarians ultimately emerged victorious with Bastian Schweinsteiger providing the clinching strike.

Real Madrid claimed an early penalty when a low cross from Angel Di Maria was blocked by the arm of a sliding David Alaba. Ronaldo, with Tuesday's penalty miss by Lionel Messi weighing over him, made no mistake from the spot, slamming his effort to Manuel Neuer's left in the sixth minute.

Bayern had several chances to quickly pull one back, but Robben and Franck Ribery were unable to provide finishing touches.

Ronaldo eventually extended Real's lead in the 14th minute following a giveaway by Bayern's midfield unit. Mesut Ozil collected the loose ball and quickly slipped a splitting pass into the path of the Portuguese star, who calmly slotted his effort into the back of the net.

The visitors were able to climb level on aggregate before the close of the first half as Mario Gomez won a penalty after being impeded by Pepe. Robben converted on the ensuing kick with a powerful shot just inside the post to narrowly avoid a save from Iker Casillas.

A tame second half and extra time period yielded a dramatic finish through penalties where the goalkeepers reigned supreme.

Against the odds, Ronaldo and Kaka both missed crucial penalties as Neuer produced key saves. Casillas followed suit, denying Toni Kroos and Philipp Lahm to keep Real Madrid in contention.

Xabi Alonso had pulled one back and Sergio Ramos stepped up to draw the home side level, but the Spanish defender sailed a powerful shot way over the crossbar to leave the door wide open for Bayern to advance.

Schweinsteiger calmly slotted home the final kick to send the Bavarians through to their final second Champions League finals appearance in the last three years. They will host English side Chelsea in their home stadium, the Allianz Arena, on May 19.