Jude Bellingham scored an injury-time tap-in as Real Madrid left it late to beat Champions League debutants Union Berlin at the Santiago Bernabeu.
Bellingham’s strike was his sixth goal in six matches for Madrid since joining Los Blancos this summer.
Real Madrid were deserved winners, having twice hit the post in the second half, although Union looked set for a fairytale draw at the home of the record 14-time winners.
The hosts, semi-finalists in last season’s competition, started brightly as Joselu headed Bellingham’s teasing cross over the bar.
But Ancelotti’s side failed to kick on in the first period, although they themselves were rarely threatened by the visitors.
In the second half, Real were a team transformed as Lucas Vazquez crossed for Rodrygo who struck the outside of the post in the 51st minute with an acrobatic effort.
Nine minutes later, Union keeper Frederik Ronnow tipped Joselu’s header on to the woodwork.
Ronnow also made a series of fine saves to keep out Rodrygo and Luka Modric, while Joselu poked a late volley narrowly wide.
But, in the final minute of injury time, Union Berlin failed to deal with a short corner and Valverde’s hopeful shot ricocheted into the path of Bellingham, who rolled the ball in from two yards out.
Union, who five years ago were playing in the second tier of German football, will hope to bounce back when they host Sporting Braga in their next Champions League Group C match in 13 days’ time.
Real Madrid travel to face Napoli on the same day.