Lionel Messi scored twice for Barcelona on Sunday as the Spanish champions concluded their league campaign with a 2-2 draw at Eibar.
The Barcelona star's brace means he finishes the season as La Liga's top scorer after finding the back of the net 36 times. Team-mate Luis Suarez and Real Madrid's Karim Benzema finish second on 21 goals each.
Meanwhile, Ernesto Valverde's side end their campaign 11 points clear of Atletico Madrid in second place, and 19 points ahead of fierce rivals Real Madrid in third.
Los Blancos' poor form continued on Sunday, as Zinedine Zidane's side were beaten 2-0 by Real Betis at the Santiago Bernabeu.
Valencia complete the top four in Spain following a 2-0 victory over Real Valladolid on Saturday to qualify for next season's UEFA Champions League. Los Che finish two points ahead of Getafe and Sevilla, who miss out but will play in the Europa League next season.
Meanwhile, Girona were relegated from La Liga following the final round of fixtures. Celta Vigo's draw against Rayo Vallecano was enough to keep Fran Escriba's side in the top flight, while Girona lost 2-1 to Alaves in their final match at the Mendizorrotza Stadium.
The results mean Eusebio Sacristan's side slip out of the Spanish top flight after two seasons in the top division and will join Rayo and Huesca in the Segunda Division next season.
Week 38 Results
Levante 2-2 Atletico Madrid
Espanyol 2-0 Real Sociedad
Getafe 2-2 Villarreal
Real Valladolid 0-2 Valencia
Sevilla 2-0 Athletic Bilbao
Alaves 2-1 Girona
Celta Vigo 2-2 Rayo Vallecano
Huesca 2-1 Leganes
Real Madrid 0-2 Real Betis
Eibar 2-2 Barcelona
Final La Liga Table (played, goal difference, points)
1. Barcelona: 38, +54, 87
2. Atletico Madrid: 38, +26, 76
3. Real Madrid: 38, +17, 68
4. Valencia: 38, +16, 61
5. Getafe: 38, +13, 59
6. Sevilla: 38 +15, 59
7. Espanyol: 38, -2, 53
8. Athletic Bilbao: 38, -4, 53
9. Real Sociedad: 38, -1, 50
10. Real Betis: 38, -8, 50
11. Alaves: 38, -11, 50
12. Eibar: 38, -4, 47
13. Leganes: 38, -6, 45
14. Villarreal: 38, -3, 44
15. Levante: 38, -7, 44
16. Real Valladolid: 38, -19, 41
17. Celta Vigo: 38, -9, 41
18. Girona: 38, -16, 37
19. Huesca: 38, -22, 33
20. Rayo Vallecano: 38, -29, 32
Lionel Messi, Barcelona: 36
Luis Suarez, Barcelona: 21
Karim Benzema, Real Madrid: 21
Iago Aspas, Celta: 20
Cristhian Stuani, Girona: 19
Wissam Ben Yedder, Sevilla: 18
Borja Iglesias, Espanyol: 17
Antoine Griezmann, Atletico Madrid: 15
Jaime Mata, Getafe: 14
Charles, Eibar: 14
Jorge Molina, Getafe: 14
Raul de Tomas, Rayo: 14
Barcelona and Eibar played out an entertaining match at Ipurua, with the hosts taking the lead after 20 minutes.
Loanee Marc Cucurella opened the scoring against his parent club with a low shot at the near post, which squirmed underneath goalkeeper Jasper Cillessen:
Barcelona hit back with Messi scoring twice in a minute to put the visitors ahead. He slipped the ball past goalkeeper Marko Dmitrovic from inside the box after being played through by Arturo Vidal on 31 minutes.
He then ran from the halfway line and chipped the ball over the goalkeeper a minute later to put Barca ahead with his 50th goal of the season:
Yet Eibar hit back just before half-time to ensure the two teams went in at the break level.
Cillessen could only head the ball clear on the edge of his penalty area, allowing Pablo de Blasis to volley home from 35 yards (UK only):
Both teams had sights of goal in an open second half, but neither could conjure up a winner, as Eibar secured a deserved point against the champions and finish their campaign in 12th.
Real Madrid's disappointing season ended with a third defeat in four games on Sunday as Real Betis picked up all three points at the Bernabeu:
The hosts went close to breaking the deadlock in the first half when Benzema hit the post just after the half-hour mark, and Paul Lopez then saved from Federico Valverde on the follow-up.
Yet Real Betis had chances of their own and forced goalkeeper Keylor Navas into some good saves. The Costa Rican had to tip over a shot from Marca Bartra and a lob from Giovani Lo Celso in the opening 45 minutes.
Vinicius Junior went close after the break, but it was the visitors who took the lead on 61 minutes through striker Loren Moron.
Andres Guardado was given time and space on the left and crossed for Moron to fire past Navas at the back post.
Real Madrid then needed Navas to be alert to save acrobatically from Lo Celso, before former striker Jese doubled the visitors' lead with 15 minutes to go.
Junior Firpo pulled the ball back for the substitute to fire high into the roof of the net and secure the victory (UK only):
Zidane opted not to bring Gareth Bale off the bench during the match, amid uncertainty over his future at the club, a decision that attracted criticism:
Meanwhile, Navas may have played his last game for the club, as noted by ESPN FC's Dermot Corrigan:
The win means Betis manager Quique Setien has guided his teams to wins at the Bernabeu and Barcelona's Camp Nou this season:
It is an impressive record by the 60-year-old but not enough to keep him at the club, as Real Betis confirmed after the match that they will part ways with their coach.