Ronaldo hat trick puts Madrid into Champions League semis
Not long before the penalty, Marcelo had prevented Bayern from scoring by making a goal line clearance after a shot by Robben had beaten Navas.
Ronaldo scored his first goal of the night with a header in the 76th minute after a well-placed cross by Casemiro from the right flank.
Two minutes later, though, Ramos found his own net when his deflection sent the ball trickling across the goal line. The Spanish defender was making his 100th Champions League appearance.
Ronaldo put Madrid back in control when he chested down a pass by Ramos and fired a left-foot shot that went underneath Bayern goalkeeper Manuel Neuer in the 105th minute.
He added another from close range after a run by Marcelo down the left flank in the 110th, and Asensio sealed the victory after getting past a series of defenders and firing home from inside the area in the 112th.