Sixteen-year-old goalkeeper Gianluigi Donnarumma saw the crucial penalty saved by Kiko Casilla, after he had earlier kept his side in the shoot-out with a save from Toni Kroos.
Casilla made two saves to deny Carlos Bacca to keep things level for Real Madrid, who enjoyed more possession but struggled to create many openings.
The Chinese heat clearly looked to be a factor in the opening stages, with neither side willing to play at a high tempo.
Chances were not forthcoming in the first half, but M’Baye Niang looked dangerous for the Italian side.
The 20-year-old saw one effort saved from distance, before he was denied by Keylor Navas after an excellent darting run into the box.
Niang then tried his luck after a good corner routine with Suso, drifting to the left-hand corner of the box before curling an effort which Navas had to parry away.
The game improved vastly after the break as several changes were made – with the likes of Karim Benzema, Cristiano Ronaldo and Gareth Bale all withdrawn early on.
Real’s first good opening came thanks to good work from Jese, who cut in from the right before pulling it back to the edge of the box, where Kroos was there to fire a first-time effort just wide of the near post.
But substitute goalkeeper Casilla was the busier of the two, and he was called into action on the hour as Cristian Zapata nodded down for Bacca, who drilled a volley at goal only to see the Real shot-stopper turn it over with an excellent save.
Bacca’s second good chance came late on after a poor pass from Sergio Ramos went straight to Luis Adriano. The forward rolled it to Bacca, who darted past two defenders and into the box, but Casilla stood his ground and turned the shot away.
The game was bound for spot kicks, and Bacca looked to have lost the shoot-out when he fired wide of the target, only to see young goalkeeper Donnarumma save from Kroos.
But both goalkeepers then struggled to get near any of the penalties before they had to take them themselves, and Casilla fired home coolly before keeping out Donnarumma’s effort to win 10-9.