A goal from Fernando Torres wasn't enough as Victor Casadesus and Giuseppe Rossi struck to Diego Simeone's men can't now finish above Barcelona in the table.
Atletico Madrid's La Liga title dream ended with a shock 2-1 loss at relegated Levante on Sunday.
The result left Diego Simeone's men three points behind Barcelona, but Luis Enrique's side has a superior head-to-head record and cannot be caught by Atletico, while Real Madrid is now two points ahead of its cross-city rival.
Simeone's charges were high on confidence after winning their last six league games and reaching the Champions League final – where they will meet Real – at the expense of Bayern Munich on Tuesday, but were brought down to earth with a bang as Giuseppe Rossi netted a late goal to shunt them down to third in the table
The Argentine coach opted to rest star attacker Antoine Griezmann, with Angel Correa getting the nod alongside Fernando Torres up front as they took on opponents whose relegation had already been confirmed.