In the battle for La Liga's coveted fourth and final Champions League berth, Real Sociedad pipped Valencia in dramatic fashion on the final day of the season.
Valencia held a two-point advantage heading into the last day but they saw that overturned after being beaten 4-3 at Sevilla - Alvaro Negredo netting all four goals for the home side - while Sociedad won 1-0 at Deportivo La Coruna.
Antoine Griezmann scored the only goal of the game in the 22nd minute as Real Sociedad, who lost Markel Bergara to an 84th-minute red card, secured a top-four finish in the top flight for the first time since 2003. The result consigned Deportivo to relegation.
Valencia, meanwhile, have to content themselves with Europa League football next season after losing a seven-goal thriller at the hands of Sevilla.
Negredo, who this week was omitted from Spain's provisional squad for this summer's Confederations Cup, struck in the 41st, 44th (pen), 57th and 61st minutes for Sevilla, with Valencia responding through Ever Banega (12) and Roberto Soldado (56 and 86).
Valencia had played the entire second half with a man less following the dismissal of Jonas Oliveira.
Champions Barcelona became only the second team in Primera Division history to reach the 100-point mark while Jose Mourinho signed off his time as Real Madrid coach with a victory as the Spanish top
Barcelona needed a win over Malaga to match the record-breaking 100-point haul Real Madrid managed last season and Tito Vilanova's men duly delivered with a 4-1 victory.
The game was as good as over inside the opening 16 minutes at Camp Nou as Barca raced into a 3-0 lead through goals from David Villa, Cesc Fabregas and Martin Montoya.
Andres Iniesta then added a fourth early in the second half for Barca's 115th league goal of the season - breaking the previous-best mark of 114 that the Catalan giants tallied last term.
Malaga pulled a goal back through Pedro Morales but it was nothing more than a consolation for the visitors, who are assured of finishing in the Europa League spots but are waiting to see if the Court of Arbitration for Sport will overturn the European ban imposed on them by UEFA.
On a night of farewells in La Liga, Eric Abidal appeared as a late substitute in the match to make his final appearance for Barca, while Malaga coach Manuel Pellegrini was taking charge of the Andalusian side for the last time.
Another manager on the move is Mourinho, who looks destined for a return to Chelsea. Mourinho's final Real Madrid match saw his side claim a 4-2 victory over Osasuna, although it was not the most convincing of triumphs amid an atmosphere of division at the Bernabeu.
The hosts squandered a 2-0 lead given to them by Gonzalo Higuain and Michael Essien as Osasuna rallied with second half goals from Roberto Torres and Alvaro Cejudo, but Karim Benzema and Jose Callejon scored late on to end the season with victory.
Opinion on Mourinho's legacy at the club would appear to be split among the Madrid faithful, with one section of the stadium singing the coach's name throughout the match, while other sections of the ground did their best to drown them out with boos and whistles.
In the fight against relegation, Real Zaragoza and Real Mallorca joined Deportivo in dropping out of the division as Celta Vigo came out top in the four-way battle to avoid the drop.
Celta Vigo secured their status as a 15th-minute Natxo Insa goal earned them a 1-0 win over Espanyol, who had Juan Forlin sent off late on.
Mallorca finished on a winning note after beating Real Valladolid 4-2 but it was not enough for them to extend their 16-year stay in the Primera Division. Mallorca's goals came from Alejandro Alfaro (17), Jose Luis Marti (43), Giovani Dos Santos (58) and Javi Marquez (68) with Alberto Bueno (30) and Omar Ramos (72) replying for Valladolid.
Real Zaragoza also bade farewell to the top flight after losing 3-1 at home to third-placed Atletico Madrid in a match where all four goals were scored in the final six minutes.
Diego Costa struck twice in injury time for Atletico after Helder Postiga's 89th-minute goal had cancelled out Arda Turan's late opener for the Copa del Rey winners.
Real Betis finished seventh after drawing 1-1 at Levante, Jorge Molina's 67th-minute equaliser for the visitors levelling up Pedro Rios' strike just after half-time.
Rayo Vallecano were forced to settle for eighth after being held 2-2 at home by an Athletic Bilbao side who played almost the entire match with a man less. Athletic lost striker Aritz Aduriz to a red card after just 10 minutes and Rayo looked set to make their opponents pay a heavy price as they went ahead almost immediately through Franco Vazquez.
The visitors hit back, however, and goals from Markel Susaeta and Jon Aurtenetxe saw them leading just after half-time. Rayo made it 2-2 through Piti before the hour but they could not go on to force a winner as the points were shared.
Rayo must now wait to see if they will be able to play Europa League football next season after the Spanish Football Federation denied them the UEFA licence they need to compete in Europe because of outstanding debts.
The club have declared their intention to take their case to the Court of Arbitration for Sport if they qualify for Europe and if they had finished seventh they would in theory have been entitled to an automatic place in the Europa League. Eighth place could yet see them qualify for Europe if Malaga's UEFA ban is upheld, and Rayo's is lifted.
In the other match, Granada beat Getafe 2-0 with goals from Manuel Agudo Nolito and Youssef El Arabi.