The holders surged through 6-3 on aggregate at an exhilarated Santiago Bernabeu to take their place in Friday's semi-final draw for a record seventh consecutive year.
But Real were pushed all the way by Bayern, who battled back from a 2-1 first-leg deficit to send the tie into extra time thanks to Robert Lewandowski's penalty and an own goal from Sergio Ramos.
However, after Arturo Vidal was sent off, Ronaldo hit the century mark in Europe's top club competition on 104 minutes and completed his hat-trick five minutes later.
"To score six goals against a team like Bayern Munich isn't easy so we deserved to go through," the Portuguese striker told Spanish TV station Antena 3.
"Real Madrid is Real Madrid, we are used to suffering and we are happy to be in the semis once again."
Marco Asensio gave a night of high-class action the finale it deserved with a sensational solo goal to rub salt in Bayern wounds.
"The (red) card for Arturo wasn't a card and then the two goals from Cristiano are offside so clearly we are not happy," said Bayern coach Carlo Ancelotti.
The German champions had been beaten on their previous four trips to Spain without even scoring a goal.
However, knowing they needed at least two to progress, Ancelotti's men started on the front foot and were left to rue a huge opportunity just eight minutes in.
Marcelo made a miraculous block to deny Thiago Alcantara before former Real winger Arjen Robben scuffed into the side- netting on his trusted left foot.
Jerome Boateng bailed out a rare mistake from goalkeeper Manuel Neuer as he cleared off the line from Ramos after Neuer fumbled a simple cross.
The half-time whistle brought some respite to proceedings on the field, although the Bayern fans were involved in a minor clash with police at the break.
The disturbances quickly died down and Bayern soon gave the travelling 4,000 from Germany something to cheer when play resumed.
Another goal-line clearance by Marcelo from Robben's dinked effort temporarily saved Madrid. But the hosts didn't escape moments later when referee Viktor Kassai pointed to the spot as Robben went down under a challenge from Casemiro.
Ronaldo looked to have eased Madrid's nerves when he steered Casemiro's cross into the far corner 14 minutes from time.
However, Real's celebrations were very short-lived as just a minute later the ball ricocheted around their box and Ramos turned into his own net.
The balance of a topsy-turvy tie turned Madrid's way again with five minutes remaining as just as in the first leg, Bayern were reduced to 10 men when Vidal saw a second yellow card for chopping down Asensio.
Ronaldo took advantage at not being flagged for offside as he controlled and fired low past Neuer to become the first man to reach a Champions League century.
Four minutes into the second period of extra time he had Marcelo to thank for a brilliant run and unselfish pass that allowed the Portuguese the simplest of finishes to complete his hat-trick despite again being in an offside position.
And Asensio sealed victory in sensational style with a stunning solo run and low right-footed finish as many Bayern players sank to their knees knowing Champions League glory had passed them by for another year.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
