MADRID (AP)Barcelona’s title drought with coach Xavi – and without Lionel Messi – is finally over.

Barcelona beat Real Madrid 3-1 on Sunday to win the Spanish Super Cup at Riyadh, Saudi Arabia, and give its fans reasons to celebrate again after a revamping process that began following Messi’s departure for Paris Saint-Germain and the arrival of former player Xavi as coach in 2021.

”We’ve been through some tough years, with financial difficulties, Messi’s departure,” Xavi said. ”It was not easy to bring back a positive dynamic. This will help give us some tranquility. We’ve been working hard from the beginning despite all the criticism, and we have to keep working.”

Barcelona had not lifted a trophy since the 2021 Copa del Rey under former coach Ronald Koeman. That was Messi’s 35th and final title with Barcelona before leaving amid the club’s financial struggles.

Robert Lewandowski, Gavi and Pedri scored a goal each in the final at King Fahd Stadium to give Barcelona its first Super Cup trophy since 2018 – and its 14th overall – and the first since the tournament began being played in a Final Four format in 2020 in a lucrative deal for the Spanish soccer federation.

Gavi opened the scoring in the 33rd minute from close range after a pass by Lewandowski, who doubled the lead after an assist by Gavi in a breakaway just before the end of the first half. Gavi also set up Pedri’s close-range goal in another breakaway in the 69th.

Karim Benzema scored for Madrid late in stoppage time.

”We knew we couldn’t miss this opportunity,” Barcelona captain Sergio Busquets said. ”We’ve been going through changes at the club and I think this triumph will make us stronger and allow us to keep competing, keep growing and keep fighting for titles.

”It’s clear that at Barca you always have to win,” Busquets said. ”We knew it was going to be like that after Xavi arrived, and now we finally have been able to do it.”

Madrid was trying to win its second consecutive Super Cup title in Saudi Arabia, and equal Barcelona’s record of 13 Super Cup trophies.

”It’s a tough loss and we have to learn from it,” Madrid coach Carlo Ancelotti said. ”We will improve and bounce back from it.”

Madrid eliminated Barcelona in last season’s semifinals, but the Spanish powerhouses had never met in the final of the revamped competition.

Both teams needed penalty shootouts to edge their opponents in the semifinals. Madrid beat Valencia and Barcelona defeated Real Betis.

Madrid beat Barcelona 3-1 at home in the first ”clasico” of the season at the Santiago Bernabeu Stadium in the Spanish league in October. It trails Barcelona by three points in the league this season.

The Super Cup used to be played between the Spanish league champion and the Copa del Rey winner. Now the runners-up in both competitions also participate. Madrid played as the league champion and Barcelona as the league runner-up. Betis won the Copa title over Valencia last season.

The current contract to play the Super Cup in Saudi Arabia runs through the 2024-25 season despite criticism over the country’s human rights record.

ATLETICO HELD IN LEAGUE

Atletico Madrid was held to a 1-1 draw at Almeria in the Spanish league, staying in fourth place and tied on points with fifth-place Villarreal and sixth-place Real Betis.

Angel Correa put Atletico ahead in the 18th but El Bilal Toure equalized for the hosts in the 37th. Atletico defender Sergio Reguilon entered the match as a substitute in the 67th but was sent off with consecutive yellow cards in the 89th.

Atletico was coming off a 1-0 home loss to leader Barcelona, which is 13 points ahead of Atletico.

Almeria, winless in three straight league games, stayed in 13th place.

Earlier Sunday, Espanyol moved further from the relegation zone with a 2-1 win at Getafe, with Joselu scoring the opening goal for the hosts with a shot from near the halfway line as the Getafe goalkeeper got caught out of position.

Defending league champion Madrid is in second place and Real Sociedad, which beat Athletic Bilbao 3-1 in the Basque Country derby on Saturday, is third.

Tales Azzoni on Twitter: http://twitter.com/tazzoni

AP sports: https://apnews.com/hub/sports and https://twitter.com/AP-Sports