France striker Antoine Griezmann scored the only goal in the 53rd minute to put Atletico within five points of leaders Barcelona in second place in the standings.
Third-placed Real, who were unbeaten in 11 matches and on a run of seven home wins going into the match, remain nine points behind bitter rivals Barcelona and will be 12 adrift if the champions win at home to Sevilla on Sunday.
Diego Simeone’s Atletico have lost only once in 10 meetings with Real in all competitions while Zinedine Zidane tasted defeat as Real’s coach for the first time in nine matches in charge.
“The league is over,” Zidane conceded. “To lose at home to Atletico is a hard blow.”
“We take it as natural to be able to win here at the Bernabeu,” Simeone told reporters.
Griezmann exchanged a one-two with left back Filipe Luis as he headed into the box and steered a sweet, low shot inside the near post past goalkeeper Keylor Navas for his 13th league goal.
It was Atletico’s first goal in three matches after two 0-0 draws and their renowned steely defence held firm to allow Real only the odd sighting of their net and just three clear chances for Cristiano Ronaldo.
“This match defines us as a team and we will continue to try and improve,” Simeone said.
Just past the half hour, Ronaldo had a free kick punched away by Jan Oblak then Karim Benzema was narrowly wide with a shot across the face of goal after the ball had come back into the box.
Griezmann had his first chance in the 41st with a shot from outside the box that was set to dip under the bar before Navas leapt to tip it over.
A minute later, the Costa Rica goalkeeper went down at the foot of his near post to turn a shot from midfielder Koke away for a corner.
Navas also saved well from right back Juanfran in the second half while the Real onslaught in the final quarter produced only two headers on target for Ronaldo, neither of much trouble to Oblak.
Danilo, playing at left back in place of fellow Brazilian Marcelo who missed the match with muscle fatigue, started a break deep in the Real half and was just wide of the far post with the finish in the home side’s last hope of an equaliser.