A scintillating score by substitute Rodrygo boosted Real Madrid chances of reaching the UEFA Champions League knockout stages.
The win gave them a 3-2 home victory over Inter Milan in an absorbing Group B clash on Tuesday.
The result left Real Madrid, winners of a record 13 titles in Europe’s premier club competition, level on four points with Shakhtar Donetsk.
They are one point behind leaders Borussia Moenchengladbach and two ahead of bottom-placed Inter Milan.
Real Madrid had thrown away a two-goal lead and was flirting with a defeat which would have piled more pressure on manager Zinedine Zidane.
Then, their Brazilian duo of Vinicius Junior and Rodrygo combined to save the day. Chances had gone begging at either end before Karim Benzema gave the home side a 25th-minute lead.
He rounded goalkeeper Samir Handanovic and slotted home after intercepting a dreadful backpass by Real Madrid’s former wing-back Achraf Hakimi.
The hosts seemed to be cruising after 33 minutes when Sergio Ramos headed their second — his 100th goal for the club in all competitions.
But Lautaro Martinez pulled one back for Inter Milan two minutes later, thanks to a sublime assist by Nicolo Barella. Real Madrid was rattled when Ivan Perisic equalised midway through the second half.
He threaded a shot into the far corner from close range after Martinez headed the ball into the Croatian’s stride.
Inter Milan then missed a pair of gilt-edged chances as Martinez shaved the outside of the post with a shot from the edge of the area and Perisic fired wide, with Real’s defence in tatters.
The Italians were punished for their misses, however. Vinicius Junior and Rodrygo, brought into the fray together by Zidane shortly before Inter Milan equaliser, carved out the winner from a lightning-fast break.
Vinicius Junior raced clear of his marker down the left flank and squared the ball back to Rodrygo, who beat Handanovic with an unstoppable shot into the top corner from 10 metres.
Inter Milan are now under pressure halfway through the group stage and will hope to have striker Romelu Lukaku back for the reverse fixture on Nov. 25. That was after the Belgium striker missed the match with a thigh injury.