The Spanish champions took a first half lead after Real's goalkeeper Iker Casillas fumbled Tiago's shot into his own net.
Although there was little Casillias could do about Saul Niguez's stunning overhead kick that gave Atletico a 2-0 halftime lead.
The visitors had hoped to cement their strong position in this season's title battle with the return of Cristiano Ronaldo, who had been suspended for two matches following a sending off last month.
But Atletico pushed on in the second half with goals from Antoine Griezmann and Mario Mandzukic sealing a historic derby day victory. Atletico are now unbeaten against Real in six matches.
"It is easy to analyze this game because Atletico were better in every facet of the game: they fought more, had more quality on the ball, had better organization, everything," Real Madrid coach Carlo Ancelotti told AFP after the match, calling it "the worst game we have played since I have been coach."
"We will reflect on it in the coming days with a cool head. We will suffer a lot from this defeat, but we need to change this attitude and avoid it happening in another game in the future," he added.
"We failed at everything, we lost all the tackles, all the high balls. We didn't have one player who played well."
Equally as unhappy was Cristiano Ronaldo. His return from suspension did little to revive what was a limp and lifeless Real performance.
"Real Madrid cannot lose 4-0 against anyone," said Ronaldo.
"We lacked desire, attitude, everything. The team wasn't fresh mentally or physically, but there are no excuses. The damage is done."
Atletico coach Diego Simeone, meanwhile, was ecstatic at his team's performance.
"I always insist that the players are the most important people," he said.
"Today their capacity to understand what we needed and execute it was fantastic."
The victory has revived Atletico's flagging title aspirations. They sit in third, with Real's lead at the top cut to seven points.
Barcelona, in second place and four points behind Real, will hope to take advantage Sunday when they play Athletic Bilbao