The holders progressed to a record seven consecutive Champions League semis after dispatching Bayern Munich 6-3 on aggregate
Needing at least two goals to progress, Bayern led when Robert Lewandowski confidently drilled in a penalty.
Madrid struggled to find rhythm at a nervy Bernabeu before Ronaldo headed in Casemiro's precise cross.
Bayern responded just 36 seconds later as Sergio Ramos' own goal forced extra time, which the Germans had to play with 10 men after Arturo Vidal was sent off.
Ronaldo was standing in an offside position when he fired in Madrid's second - and then Bayern crumbled.
The Portugal captain tapped in the third - for his 100th Champions League goal - after Marcelo's marauding run, with Marco Asensio sealing victory by firing into the bottom corner.
Madrid will discover their semi-final opponents when the draw is made on Friday.
In the other quarter finals Champions League game played on Thursday, Atletico Madrid held Leicester City to a one all to progress to the semis 2-1 on aggregate.