Diego Simeone's side trailed to Oscar Plano's strike but turned the match around in the second half through goals from Angel Correa and Luis Suarez.
Real scored twice late on to beat Villarreal 2-1 but came up short as they needed Atletico to drop points.
Atletico clinched their first title in seven years and their 11th overall.
It was a highly satisfactory triumph for Los Colchoneros as they finished just two points ahead of defending champions Real, who end the season without silverware.
Barcelona - playing without skipper Lionel Messi, who was resting before the summer's Copa America - won 1-0 at Eibar through Antoine Griezmann's acrobatic strike and clinched third place ahead of Sevilla.
Julen Lopetegui's side play their final league game on Sunday against Alaves but will finish fourth even with a victory because of an inferior head-to-head record against Barca.