Real Madrid substitute Rodrygo struck an 89th-minute winner to snatch a 1-0 Champions League group-stage victory and punish a wasteful Inter Milan.
The Brazilian met a pass from Eduardo Camavinga and volleyed in with seconds remaining of normal time.
It was a painful conclusion to a game the Italian side had dominated for large stretches at the San Siro.
Thibaut Courtois was in fine form to save a header from Lautaro Martinez and two efforts from Edin Dzeko.
Real are second in the group behind Moldovans Sheriff Tiraspol, who stunned Shakhtar Donetsk with a 2-0 win on their tournament debut.
Sheriff travel to Madrid next, while Shakhtar and Inter will look to get their first points on the board when they meet in Ukraine.