Ten-man Bayern Munich had goalkeeper Manuel Neuer to thank for keeping the scoreline down as Real Madrid beat them 2-1 in their Champions League quarterfinal first leg as Cristiano Ronaldo netted his 100th European goal.
Bayern were forced into a change before the game as Robert Lewandowski was ruled out with a shoulder injury, with Thomas Muller replacing him up front.
Bayern started the stronger of the two, but there was little action in the opening 15 minutes as Ronaldo fizzed a free kick well over the bar.
Real Madrid then came close to opening the scoring and grabbing a vital away goal as Neuer tipped Karim Benzema's downward header onto the bar and claimed the rebound well.
Madrid gave the ball away as Bayern continued to press and David Alaba's shot whistled over the bar from distance, then Franck Ribery had a shot blocked.
The signs were there and Bayern took the lead on 25 minutes as Arturo Vidal leaped highest from the resulting corner to power a header past Keylor Navas, leaving his marker Nacho in the dust.
Casemiro required treatment twice in the space of five minutes, first for a bang on the head and then for a leg injury after a tangle with Vidal.
Just before the break, Vidal had two wonderful chances to add to the lead. First, a cross from Arjen Robben found his head, but he could not find the target. Then, Dani Carvajal was adjudged to have handled in the box after a Ribery shot but Vidal blasted his penalty kick over the bar.
Bayern went into half-time ahead, but it was 1-1 within two minutes of the restart. Ronaldo latched on to a low cross from Carvajal to direct the ball home for his 99th goal in UEFA club competition -- and first for 659 minutes in the Champions League.
Minutes later Real Madrid should have been ahead, but for a magnificent save from Neuer. The goalkeeper somehow managed to tip over a free header from Gareth Bale as the Welshman found space six yards out.
Marco Asensio replaced Bale shortly after and Bayern were soon down to 10 men as Javi Martinez was shown a second yellow card for a foul on Ronaldo in the centre circle.
Bayern made their own chances as Xabi Alonso went off to be replaced by defender Juan Bernat.
Sergio Ramos curled a free kick narrowly wide before Asensio's cross found Benzema, only for the Frenchman to make a mess of his free header.
On 72 minutes, Benzema had an even better chance. Carvajal found space down the right hand flank and fed the striker, but his low shot was beaten away well by Neuer. The Germany goalkeeper then had to dive low to claim Asensio's effort as Real Madrid cranked up the pressure.
Two minutes later, Neuer came to the rescue once more as he stuck out a strong hand to deny a thumping Ronaldo shot from just by the penalty spot.
But Neuer could not deny the Portugal captain for long. Ronaldo bagged his 100th goal in European football as he poked home Asensio's cross after getting the wrong side of Boateng to make it 2-1.
Ramos had a goal chalked off for offside in the final stages but the holders already have a real advantage going into the second leg.