The winner was Ronaldo’s 99th Champions League goal and came just before half time in extra time, with his third goal making it a magical 100 for Ronaldo.
Bayern had forced extra time despite the sending off of Arturo Vidal in the second half.
Robert Lewandowski scored the opener after 53 minutes to tie the match on aggregate but Ronaldo struck with 14 minutes to go.
Cristiano Ronaldo scored five goals over two legs to send Real Madrid into the semi-finals
Real Madrid sailed into the last four after extra time
Sergio Ramos then put through his own net to send the game to extra time before the Vidal sending off.
Ronaldo then got two in extra time before Marco Asensio finished proceedings by making it 4-2 on the night and 6-3 on aggregate.
Real Madrid, still on course to win back-to-back European Cups, join Atletico Madrid in the semi-finals after they beat Leicester.
Arturo Vidal was controversially sent off in the second half
Zinedine Zidane is on course to win back-to-back Champions Leagues Real Madrid transfer odds: Which Premier League aces could move? Thu, March 30, 2017
Get Quotes on Home Insurance
Click to reveal the best transfer odds for superstars moving to Real Madrid, courtesy of 888sport
Play slideshow GETTY 1 of 11
The latest transfer odds for Real Madrid's summer deals, courtesy of 888sport