Cristiano Ronaldo scored twice for Real Madrid to beat Bayern Munich 2-1 in the first leg of their Champions League quarterfinal on Wednesday, ending the German side's tournament record of 16 straight wins at home.

Ronaldo's second-half goals ensured Madrid came from behind — after Arturo Vidal's 25th-minute header — to put the defending champions on course to reach the semifinals for a seventh successive year. The second leg takes place in Madrid on Tuesday.

Bayern was without club top-scorer Robert Lewandowski after he failed to recover from a knock to his right shoulder. But it had not been beaten at home in the competition since April 2014, when it lost 4-0 to Madrid in the semifinals.

Bayern's players were crestfallen at the final whistle (Getty)

Bayern forced several corners early on and the sixth finally paid off when Vidal headed home through Keylor Navas' fingers.

Bayern should have been 2-0 up at the break, but Vidal sent his penalty well wide of the mark after Dani Carvajal was adjudged to have handled the ball.

Ronaldo scored two minutes after the interval with one touch to Carvajal's cross.

Ronaldo scored his 100th goal in European competition (Getty)

Bayern was dealt a blow with a half-hour to play when Javi Martinez was sent off with two yellow cards within three minutes for fouls on Ronaldo.

Manuel Neuer denied Karim Benzema, then Ronaldo from point blank, but the Bayern 'keeper couldn't stop the ball from squirming between his legs in the 77th to give Madrid the clear advantage.

Who impressed at the Allianz Arena? Take a look at the gallery above to find out how we rated the players.

Do you agree with our ratings? Who was your man of the match? Let us know in the comments.