BARCELONA, Spain — Lionel Messi scored twice to hit the 50-goal mark for the sixth time in his career on Sunday while Real Madrid put a fittingly poor ending to its worst season in recent memory after losing in the final round of the Spanish league.
Messi scored his 49th and 50th goals in all competitions this season to give Barcelona a 2-2 draw at Eibar and finished as the league's top scorer with 36 goals for the Spanish champions.
This is the sixth season Messi has finished as the top La Liga scorer, equaling a record held by Athletic Bilbao striker Telmo Zarra from the 1950s.
Barcelona, which had clinched the league title with three rounds to play, will now look to also retain the Copa del Rey title next weekend when it faces Valencia. Its chance of a rare treble of major titles was ended by Liverpool in the Champions League semifinals.
Barcelona won the league with 11 points more than second-place Atletico Madrid. It also finished 19 points ahead of Madrid, the biggest-ever points advantage by Barcelona over its fiercest rival.
"We were very consistent all season long and that's what allowed us to win the league by such a comfortable margin," Barcelona coach Ernesto Valverde said.
JEERS FOR MADRID
Madrid endured the jeers of its own frustrated fans after a 2-0 loss to Real Betis at the Santiago Bernabeu.
Most of Madrid's supporters have long placed their hopes on what changes the club will make to an underperforming squad in the summer.
Not even coach Zinedine Zidane could find a saving grace to the campaign.
"It isn't that we don't want to (play better), we aren't able to," Zidane said. "The best thing is for this to be over. We are already thinking about the future and next season."
Madrid entered the match with nothing to play for, locked into a third-place finish for the second consecutive season for the first time since 1974.
Since the return of Zidane to take charge of the club after its shock loss to Ajax in the round of 16 in the Champions League, Madrid has finished the campaign with a record of five wins, two draws and four losses.
"The fault is ours," Madrid defender Marcelo said. "We didn't start well and we didn't finish it well either. In no way was this the season we wanted to have."
Messi moved four goals ahead of Paris Saint-Germain forward Kylian Mbappé — who has 32 in the French league with a round left — as the top scorer in Europe's major domestic leagues.
Marc Cucurella, a Barcelona youth player on loan to Eibar, opened the scoring before Messi got his first goal from a pass by Arturo Vidal in the 31st.
Messi added a second just a minute later when he broke behind Eibar's high defensive line, received the ball from Ivan Rakitic and chipped it over goalkeeper Marco Dmitrovic.
Eibar defender Pablo de Blasis levelled just before halftime when he scored from distance into an open net after Barcelona goalkeeper Jasper Cillessen made a poor clearance with his head outside the area.
Barcelona right back Nelson Semedo was taken to the hospital for tests after he received a knock on the head and had to be substituted.
Youth player Carles Pérez debuted for Barcelona in the second half.
TEAM WINS, SETIÉN LOSES
The victory at Madrid didn't save Quique Setién's job.
Betis announced shortly after that Setién and the Seville-based club had agreed to part ways after two seasons together, confirming weeks of speculation that he was on his way out.
At least Setién's last match in charge was one to remember for the coach.
Betis outplayed the hosts from the start and got second-half goals from Loren Morón and former Madrid forward Jesé Rodríguez.
A long ball by Giovani Lo Celso set Andrés Guardado free down the left as he sprinted clear of Raphael Varane before crossing for Morón to score.
Lo Celso then slipped a ball through to Junior Firpo, who found Jesé unmarked at the edge of the six-yard box.
Betis, which beat both Madrid and Barcelona at their stadiums, ended the season in 10th place.
"This allows us to finish a season that has been a bit disappointing with a victory against a team and at a stadium that will always be a nice memory," Setién said before the club announced his departure.
HOW IT ENDED
Champion Barcelona, Atletico, Madrid and fourth-place Valencia qualify for the Champions League. Getafe, Sevilla and Espanyol took the Europa League spots.
Girona, Huesca and Rayo Vallecano were relegated.
More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports