MADRID (AP)Barcelona defeated Real Sociedad 1-0 on Thursday to make sure Real Madrid will have to wait at least another week to celebrate the Spanish league title.

Barcelona’s away victory reduced its gap to Madrid to 15 points, and it can further cut it to 12 points on Sunday if it defeats Rayo Vallecano at home in a game it has in hand.

Barcelona and Madrid, which won 3-1 at Osasuna on Wednesday, will have five games left. Madrid, trying to clinch its second title in three seasons, doesn’t play this weekend.

”Madrid was lucky that it took a while for us to join the fight,” Barcelona defender Dani Alves said.

Pierre-Emerick Aubameyang scored with a close-range header in the 11th minute to give Barcelona its first win after consecutive home losses against Cadiz in the league and Eintracht Frankfurt in the Europa League. The Catalan club had not lost two straight home games since 2003.

The victory against Sociedad left Barcelona tied on points with Sevilla, which defeated Levante earlier Thursday to stay in position to secure a Champions League place next season. Second place also is important as it guarantees a spot in the Spanish Super Cup.

”We suffered a lot but in the end we got three golden points and stayed in second place,” Barcelona coach Xavi Hernandez said. ”It was an important victory even though we didn’t play too well.”

Defending champion Atletico Madrid, which was held to a 0-0 home draw against relegation-threatened Granada on Wednesday, stayed two points behind Barcelona and Sevilla. Fifth-place Real Betis trailed Atletico by four points and was two ahead of Sociedad.

Sociedad has not beaten Barcelona in 12 straight league matches. The Basque Country club hadn’t lost in seven consecutive league games at home, all of them with clean sheets.

Barcelona extended its unbeaten streak on the road to 13 league matches, having won five in a row.

Barcelona defender Ronald Araujo left injured early in the second half, and the team’s other central defender, Gerard Pique, appeared to get injured in the first half but stayed until being substituted in the 82nd while being loudly jeered by the Sociedad fans.

Pique, who also heard some boos every time he touched the ball during the game, has been in the spotlight in recent days after stolen audio leaked to the media exposed a series of conversations between him and Spanish soccer federation president Luis Rubiales talking about behind-the-scenes negotiations on several issues.

SEVILLA RECOVERS

Sevilla improved its chances of making it to the Champions League with a 3-2 win at second-to-last-place Levante.

Jesus ”Tecatito” Corona scored two first-half goals and Jules Kounde added another after halftime.

Levante captain Jose Luis Morales had to be comforted by teammates and opponents after the match because of a missed penalty kick that could have equalized the game at 2-2 in the second half. Kounde gave Sevilla a 3-1 lead about 10 minutes later before Roberto Soldado pulled the hosts closer again.

Levante stayed tied with last-place Alaves, six points from safety.

CADIZ FALLS AGAIN

Cadiz followed up its stunning 1-0 win against Barcelona at the Camp Nou Stadium with a 3-2 home loss against Athletic Bilbao.

The result left Cadiz just outside the relegation zone.

Eighth-place Athletic was up 3-0 by the 33rd. It played a man down from the 71st after Mikel Vesga was sent off.

RELIEF FOR RAYO

Rayo won 1-0 at Espanyol to end a 13-match winless streak in the league and move closer to salvation.

Sergi Guardiola scored in the 42nd to leave the southern Madrid club seven points from the relegation zone in 14th place. Espanyol, sitting in 12th-place, was two points ahead of Rayo.

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

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