Barcelona secured a commanding 3-0 victory over Rayo Vallecano, clinching the coveted second place in the Spanish league on Sunday.
Meanwhile, Real Madrid settled for a 4-4 draw against Villarreal, with Norway's Alexander Sorloth scoring all four goals for the hosts.
As the season nears its end, there is little left to contest, with Cadiz's relegation confirmed after a goalless draw against Las Palmas.
Real Sociedad secured the final Europa League spot with a 2-0 win over Real Betis, who will settle for a place in the Europa Conference League.
Barcelona's triumph was highlighted by Pedri's brace and a goal from Robert Lewandowski, maintaining a four-point lead over Catalan rival Girona with one round remaining.
Girona secured their first-ever third-place finish in La Liga with a 3-1 victory against Valencia, having already secured a spot in the Champions League.
Meanwhile, Atletico Madrid's fourth-place finish was confirmed after a 4-1 defeat to mid-table Osasuna at the Metropolitano stadium.
Barcelona secured second place with a 3-0 victory over Rayo Vallecano, with Lewandowski scoring in the third minute and Pedri adding goals in the 72nd and 75th.
The win ensured Barcelona's spot in the lucrative Spanish Super Cup in Saudi Arabia.
Madrid and Copa del Rey finalists Mallorca and Athletic Bilbao will also play in the Super Cup next season.
The victory came a day after Xavi denied reports in Spanish media that Barcelona’s leadership is considering firing the coach for saying that the club’s poor finances will impede it from competing with Madrid.
"The situation hasn't changed,” Xavi said. "I imagine I'll speak with the president tomorrow or the next day. We needed the win to secure second place and we did it."
Some fans chanted in support of Xavi and against Laporta during Sunday's match.
Rayo Vallecano finished in 16th place.
Alexander Sorloth scored once in the first half and three times in the second to give eighth-place Villarreal a draw against Madrid, which scored all of its goals before halftime.
Arda Güler scored twice and Joselu and Lucas Vazquez added a goal each for Madrid, which played with a mostly reserve squad as it continues to prepare for the Champions League final against Borussia Dortmund on June 1 in London.
Madrid had clinched their 36th league title three rounds ago.
Cadiz needed a win against Las Palmas to avoid returning to the second division for the first time since the 2019-20 season.
Cadiz, coming off two consecutive victories, had a goal disallowed by video review for offside in the first half and saw defender Victor Chust sent off with a straight red card in the 74th.
Cadiz had spent 14 straight seasons in the lower divisions – including seven years in the third tier – before making it to the top flight in 2020-21.
Almeria and Granada had already been relegated before Sunday's games.
Real Sociedad sealed the final Europa League spot with a win against Manuel Pellegrini's Real Betis.
Brais Mendez and Mikel Merino scored first-half goals for Sociedad, which won three of its last four games.
The other Europa League place had been secured by Athletic Bilbao, which beat 13th-place Sevilla 2-0.
In other results, 17th-place Mallorca drew 2-2 against last-place Almeria, and Celta Vigo won 2-1 at second-to-last Granada.