Bruno Cesar's second-half goal looked to have given the Portuguese side a memorable triumph at The Bernabeu, yet ex-Sporting forward Cristiano Ronaldo popped up with a late leveller before Alvaro Morata snatched a winner four minutes into stoppage time.
“We're happy because we believed until the very end and we didn't let our heads drop," said Real coach Zinedine Zidane.
“Sometimes we face teams that play very well and make things difficult for us. But this is Real Madrid and things can change in an instant. The first half was tough but we improved and were better in the final third. And in the end we got the win."