PSG stunned the home fans when Adrien Rabiot opened the scoring just after the half-hour mark, but Ronaldo pulled Zinedine Zidane’s side level from the penalty spot moments before half-time.
Ronaldo struck again late on to put Los Blancos ahead in the last-16, first-leg tie and Marcelo completed the comeback win at the death.
The first half was a feisty affair with firm challenges being made by players from both teams, resulting in bookings for Isco, Neymar and Giovani Lo Celso.
Ronaldo sent an early warning to the visitors when he flashed a volley across the face of goal from a tight angle after being played in on the right by Isco in the third minute.
Toni Kroos tested Alphonse Areola two minutes later with a left-footed shot from the edge of the box that the keeper parried and Marquinhos smashed the ball behind at the left post.
PSG’s first foray into the final third saw Yuri Berchiche latch onto Neymar’s through-ball and drag a left-footed effort wide of the right post from 16 yards out on seven minutes.
The action went quiet until the 26th minute when Ronaldo fired a free-kick over the crossbar from 20 yards out, and the Portuguese forward was presented with another good chance two minutes later as he received a sumptuous pass from Marcelo on the left, but his shot was saved by the face of Areola.
Neymar threatened on the half-hour mark when he waltzed his way to the edge of the area before drawing a routine save out of Keylor Navas with a tame strike, while at the other end Areola kept out Sergio Ramos’ towering header from a 32nd-minute corner.
However, PSG broke the deadlock moments later as Kylian Mbappe got away down the right flank and sent in a low cross that was cut out by Nacho but fell kindly for Rabiot, who slotted past Navas from 13 yards out.
Ronaldo was wasteful again on 37 minutes having won the ball back off Berchiche on the right, but he blasted a left-footed shot over the target from 14 yards out, and Edinson Cavani went close at the opposite side of the pitch moments later with a shot on the turn that deflected wide of the right post.
Areola preserved the French giants’ lead with a fantastic one-handed save to turn Karim Benzema’s first-time strike around the left post on 44 minutes, but he was beaten by Ronaldo from the spot soon afterwards when Lo Celso conceded a penalty for a tug on Kroos; shoulder.
Navas was called into action early in the second half as he got down to his right to keep out Mbappe from Neymar’s delivery into the box on the right on 49 minutes.
Unai Emery’s men did well to stifle Real after the break, and Zidane went to his bench for inspiration, with Gareth Bale, Lucas Vazquez and Marco Asensio introduced in the final 22 minutes.
It paid off as Asensio played a crucial role in their two late goals. The Spaniard’s cross from the left was parried back into the danger area by Areola, and Ronaldo diverted the ball into the back of the net with his knee on 83 minutes.
Asensio then set up Marcelo to extend Los Blancos’ lead three minutes later with a cut-back on the left that the Brazilian converted from eight yards out via a deflection off Marquinhos.
PSG pushed for a second goal in the final few minutes as substitute Julian Draxler skied an effort well over from 20 yards out on the left, before Mbappe forced a save out of Navas from a tight angle on the left.
Neymar failed to even hit the target in stoppage time having timed his run to get on the end of a cross from the left, but he steered the ball well over from eight yards out.