Real Madrid capped their dominant Spanish league campaign with a 4-1 win over Mallorca on Sunday to give the champions a record 100 points this season, while Villarreal and Sporting Gijon joined already relegated Racing Santander in being demoted to the second division.
Cristiano Ronaldo opened the scoring at the Santiago Bernabeu in the ninth minute. Karim Benzema scored four minutes later, and Mesut Oezil struck a brace after half-time.
Also, Raul Tamudo scored in stoppage time to give Rayo Vallecano a 1-0 win over Granada that lifted his team out of the drop zone and condemned Villarreal. The veteran striker headed in a rebound off the crossbar to send the fans at Vallecas stadium in the Spanish capital streaming onto the pitch.
Malaga, who had made a $90-million overhaul of their squad this season, saw their investment finally pay off when they beat Sporting Gijon 1-0 through Jose Rondon's header to secure a fourth-place finish. They will join Madrid, Barcelona and Valencia in the European Champions League for the first time ever.
Villarreal, who were decimated by injuries this season, were in control of their own fate until Radamel Falcao scored late to give Atletico Madrid a 1-0 win only minutes before Tamudo grabbed Rayo's last-gasp winner.
Atletico finished in fifth place, falling just short of their goal of making the Champions League.
Levante beat Athletic Bilbao 3-0 to qualify for the Europa League for the first time, putting an incredible end to their historic season that saw also them move top of the table for the first time ever to start the season.
Striker Abdelkader Ghezzal scored a brace before Javier Farinos added a third goal to give the team with the smallest budget in the league their crucial victory.
Zaragoza escaped the drop zone for the first time in 26 weeks with a 2-0 win over eight-man Getafe. Antonio "Apono'' Galdeano scored a penalty in the 58th minute and Angel Lafita secured Zaragoza their fourth straight victory.
Getafe's Pablo Sarabia was sent off with two yellow cards for protesting before Miguel Torres joined him for handling in the area. Apono converted the resulting penalty to complete Zaragoza's revival.
Zaragoza played the last 10 minutes a man down after Tomislav Dujmovic was sent off for dangerous play, before Getafe's Nicolas "Miku'' Fedor sent off with a red card for a hard tackle.
Also, Osasuna beat Racing 4-2, and Sevilla drew 1-1 at Espanyol. Osasuna, Mallorca, and Sevilla all finished just outside the Europa League spots.
Madrid padded their league record for goals scored in a season with 121, while Ronaldo added to his club records with his 46th league goal and 60th in all competitions this campaign.
The Spanish powerhouse's 32nd victory of the season gave them one more point than the 99 that Barcelona collected in 2010.
Madrid set a frenetic pace from the beginning, with goalkeeper Dudu Aouate saving strikes by Sami Khedira and Karim Benzema in the first eight minutes.
Ronaldo headed in Marcelo's cross, jumping over two defenders to send the ball beyond Aouate. The Portugal forward's total of 46 goals bettered his mark of 40 from last season, but fell short of Barcelona forward Lionel Messi's league record 50 goals this season.
Moments later Benzema slotted into the right lower corner to make it 2-0 after Ronaldo and Gonzalo Higuain linked up to play the France striker clear at the top of the area.
Oezil made it a rout three minutes after half-time when the Germany playmaker lifted an exquisite left-footed shot over Aouate.
In Mallorca's first approach to Iker Casillas' goal, Chori Castro pulled one back in the 52nd before Oezil got his double with a volley of a cross by Marcelo in the 58th.