Alvaro Morata scored twice as Atletico Madrid ended Real Madrid's 100 per cent start to the La Liga season with a fine victory over their city rivals.
They led inside four minutes when former Real forward Morata converted Samuel Lino's dangerous cross.
Antoine Griezmann then made it 2-0 with another header, before Toni Kroos' fine low strike halved the deficit.
But Morata sealed Atletico's victory when he rose highest to meet Saul Niguez's ball in after the break.
Victory moved Atletico up to fifth in the table, while Real are third - behind leaders Barcelona and Girona - after dropping points for the first time this season.
Atletico had only won one of their past 14 La Liga Madrid derbies before this match, but stunned their bitter rivals with two goals in the opening 18 minutes and then defended resolutely thereafter.
England midfielder Jude Bellingham, who has been in inspired form since joining Real in the summer, cut a frustrated figure throughout, culminating in a yellow card for a poor challenge on Angel Correa in stoppage time.
The 20-year-old scored six goals in his first six appearances for the club in all competitions, but this result means he tastes defeat for the first time as a Real Madrid player.