Real Sociedad beat Real Betis 2-0 on Sunday in La Liga's penultimate round of matches to clinch Europa League qualification next season at the expense of their opponents.

Cadiz, 18th, were relegated after they could not find a winner in a 0-0 draw against Las Palmas.

Villarreal forward Alexander Sorloth struck four times against champions Real Madrid in a thrilling 4-4 draw, while Barcelona secured second place with a comfortable 3-0 win over Rayo Vallecano.

With Real Madrid gearing up for the Champions League final on June 1, Carlo Ancelotti picked a side filled with reserves.

Turkish teenager Arda Guler put Madrid ahead and Joselu headed home the second after half an hour.

Villarreal hitman Sorloth pulled one back for the hosts but Madrid immediately restored their lead.

Lucas Vazquez added the third before Guler, 19, struck again with his sixth goal in seven games.

Sorloth headed in his second soon after half-time and swiftly completed his hat-trick.

The Norwegian striker put the finishing touch on a sublime team move to level with his fourth, and reach 23 goals for the season, making him the top scorer going into the final week.

"We did what we had to do, played with intensity to prepare ourselves for the last match of the season," said Madrid coach Ancelotti.

"I'm not worried (about the goals conceded), it was a very open game, with little balance, we played attacking football, maybe we let in more than we needed.

"It doesn't change anything -- the (Champions League) final does not have to be like this."

It's not nice

Multiple reports before Barca's match against Rayo Vallecano said president Joan Laporta had decided to sack coach Xavi Hernandez, just weeks after the former Barca midfield great confirmed he would stay.

"Barca yes, Laporta no," chanted some fans in response, although others whistled them with opinions split.

Robert Lewandowski fired Barcelona ahead early on after Lamine Yamal drafted a cross to the back post, with the 16-year-old making his 50th appearance for the club.

Rayo came close on a few occasions before substitute Pedri doubled Barcelona's lead after some fine footwork by Joao Felix.

The Canary Islander, bursting into form ahead of Euro 2024, ran in behind the defence to add his second from Ronald Araujo's perfect long ball.

Last season's champions Barcelona failed to win any silverware in a disappointing campaign.

"To be totally honest, I didn't like it," Xavi told reporters when asked about the chants against Laporta.

"It's not nice for me. What I want is that the family is good, but it's the fans who decide.

"I feel appreciation from the fans but I didn't like the chants against the president."

Xavi reiterated his words before the game, saying the club conveyed "calmness" to him and that there was no development to report on his future.

Barcelona are guaranteed to finish ahead of upstart neighbours Girona, who earned a 3-1 win at Valencia.

Artem Dovbyk's goal leaves him two behind Sorloth in the race for Spain's golden boot.

Europa bound

Brais Mendez sent Real Sociedad ahead early on against Betis with a perfectly-placed free-kick as they secured sixth place.

Manuel Pellegrini's side, shorn of key injured midfielders Isco and Guido Rodriguez, battled hard to level but Mikel Merino doubled the visitors' lead shortly before half-time.

Alex Remiro saved Ez Abde's penalty to keep Betis at arm's length and Ayoze Perez had a goal disallowed for the hosts, who will play in the Conference League next season.

Athletic Bilbao stalwarts Raul Garcia and Iker Muniain both struck on their last home game for the fifth-place Copa del Rey winners in a 2-0 victory against an underwhelming Sevilla.

Diego Simeone's Atletico Madrid, guaranteed to finish fourth, fell 4-1 at home against a rampant Osasuna.

There is nothing left to play for in the final week of the season, with Cadiz joining Granada and Almeria in Spain's second division next season, while the European qualifying places are set.