Stuttgart dominated the early stages as Real Madrid got off to a slow start, with the German side creating several glorious goalscoring opportunities, but Thibaut Courtois' resilience kept them at bay.
Real Madrid eventually started to gain more possession and grow into the game, but the visitors remained dangerous on the counter, with Deniz Undav nearly opening the scoring when his shot deflected off Dani Carvajal and looped over Courtois before hitting the crossbar.
Los Blancos started ramping up the pressure just before the 30-minute mark and thought they had a penalty when the referee awarded a foul for a supposed kick on Antonio Rudiger, but a lengthy VAR check deemed there was no contact and the decision was overturned.
Carlo Ancelotti's half time team talk clearly resonated with the hosts, as they burst out of the blocks from the restart, with Rodrygo delivering a perfect chance on a platter for Kylian Mbappe to tap into an empty net within a minute.
The momentum was firmly in Real Madrid's favour in the subsequent 15 minutes, with Vinicius Junior coming close to putting the game to bed when his left-footed effort struck the crossbar on the hour mark.
Los Blancos soon rued their missed chances as Undav deservedly equalised for the visitors with just over 20 minutes remaining, skilfully cushioning his back-post header across goal and into the far corner.
In true Real Madrid fashion, particularly in the Champions League, they found a way to take the lead again despite not being at their best, this time when Rudiger headed in a corner from Luka Modric to make it 2-1 for the hosts.
REAL MADRID VS. STUTTGART HIGHLIGHTS
Mbappe goal vs. Stuttgart (46th min, Real Madrid 1-0 Stuttgart)
A wonderful curved pass from Aurelien Tchouameni just eludes the defender, giving Rodrygo the space to drive towards goal and slide a pass across the box for Mbappe to sweep into the empty net.
Undav goal vs. Real Madrid (68th min, Real Madrid 1-1 Stuttgart)
A corner for Stuttgart was flicked to the far post, where Jamie Leweling was able to chest the ball and volley it back into the action.
The powerful cross was met by Undav at the back post, with the striker brilliantly taking the sting out of the ball, cushioning his header across goal and into the net to deservedly level for the visitors.
Rudiger goal vs. Stuttgart (83rd min, Real Madrid 2-1 Stuttgart)
Modric's corner is delivered perfectly into the middle of the box, where Rudiger climbs highest and heads the ball into the goal to restore Real Madrid's lead.
Endrick goal vs. Stuttgart (96th min, Real Madrid 3-1 Stuttgart)
Endrick collects the ball from a Stuttgart cross and drives towards the opposition goal, with his eventual shot being pushed into the corner by a disappointed Alexander Nubel.
MAN OF THE MATCH - RUDIGER
Los Blancos were far from at their best in either defence or attack throughout their encounter with Stuttgart, but Rudiger certainly produced an admirable performance to help his team take all three points from their opening 2024-25 Champions League fixture.
The former Stuttgart defender not only scored the winning goal in the 83rd minute, but Rudiger was also instrumental in defence, making one interception, one tackle and winning three duels to help keep the visitors at bay.
REAL MADRID VS. STUTTGART MATCH STATS
Possession: Real Madrid 46%-54% Stuttgart
Shots: Real Madrid 20-17 Stuttgart
Shots on target: Real Madrid 8-7 Stuttgart
Corners: Real Madrid 10-6 Stuttgart
Fouls: Real Madrid 13-9 Stuttgart
BEST STATS
WHAT NEXT?
Having kickstarted their quest for a record-extending 16th Champions League title with a well-earned victory after a strong second-half showing, Real Madrid will now turn their attention to maintaining their unbeaten start to the 2024-25 season when they host Espanyol on Saturday in La Liga.
As for Stuttgart, the Swabians will be looking to bounce back from a disappointing defeat when they return to their home ground to face Borussia Dortmund in the Bundesliga.