Cristiano Ronaldo and Alvaro Morata spoiled the party for Sporting CP with two late goals bringing Real Madrid from behind to win 2-1 in a dramatic Champions League Group F encounter at the Santiago Bernabeu.
The reigning champions looked set for a shock defeat before Ronaldo stepped up and picked out the top-right corner directly from a set-piece 25 yards out, and Morata secured all three points with a 94th-minute header.
Ronaldo's 350th appearance for Madrid came against the club where he made his debut, and it looked set to be a frustrating one when Bruno Cesar put Sporting ahead two minutes into the second half.
The Portuguese side had coach Jorge Jesus sent to the stands for his remonstrations at referee Paolo Tagliavento's decision to book William Carvalho for a challenge on Luka Modric, and from there his team came under increased pressure.
Ronaldo rattled the post from inside the six-yard box with seven minutes remaining and he finally hit the net in the 89th minute, Sporting goalkeeper Rui Patricio getting a hand to the ball but failing to stop it flying in off the upright.
The 31-year-old refused to celebrate against his former club, but 67th-minute substitute Morata – dropped with Zinedine Zidane favouring Karim Benzema from the start – had no such qualms when he sent the home fans into raptures in the fourth minute of stoppage time.
Sporting showed they had come to Madrid to play positively and went close within two minutes, Bruno Cesar bending a left-footed shot from 20 yards just outside Kiko Casilla's right-hand post before Gelson Martins warmed the goalkeeper's gloves.
In the opening period Sporting keeper Patricio was only tested by a thunderous 30-yard strike from Ronaldo which needed a pair of hands to stop it swerving and dipping under the crossbar.
The Portuguese side started the second half just as they did the first, but this time Bruno Cesar did not fail to get the better of Casilla within two minutes of the restart.
Sergio Ramos and Modric failed to stop Bryan Ruiz poking a pass through to the Brazilian, and he curled a sublime effort into the bottom-left corner from the right-hand side of the box.
Jesus was removed from the touchline in the 57th minute, and Zidane soon moved to replace Gareth Bale – who appeared to pick up a hip injury in the first half following a challenge from Sebastian Coates – and Benzema with Lucas Vazquez and Morata in the 67th minute.
The hosts quickly began playing with greater energy, but Ronaldo passed up the chance for an equaliser when he turned Dani Carvajal's cross onto the upright.
But the Madrid superstar was not to be denied his moment in the limelight, and he fired home a free-kick to level the match in the 89th minute.
The turnaround was completed five minutes later when Morata powered in a header from substitute James Rodriguez's left-wing cross.
The result will ease the pressure on Madrid ahead of a tricky trip to Borussia Dortmund on September 27, while Sporting will try to pick up the pieces when they entertain Legia Warsaw.