BARCELONA, Spain (AP)While Real Madrid’s players went back to training after celebrating the club’s latest Spanish league title, Barcelona had a peace offering for its fans by ending an embarrassing losing streak at Camp Nou on Sunday.

Goals from Memphis Depay and Sergio Busquets in each half were enough to beat Mallorca 2-1 and move Barcelona back ahead of Sevilla into second place. More importantly, it opened up a nine-point gap over fifth-place Real Betis in the fight for a top-four finish and a lucrative Champions League berth.

But the win was otherwise made meaningless after Madrid’s 4-0 victory over Espanyol the day before had clinched its record-extending 35th league title.

After parading the trophy for thousands of fans immediately after the win on Saturday in the Spanish capital, Madrid coach Carlo Ancelotti put out the cigar he was seen smoking alongside his playersduring the party and ordered them back to practice. Madrid is preparing to face Manchester City in their Champions League semifinal decider on Wednesday and needs to overturn a 4-3 loss in the first leg. Madrid said that Sunday’s session included sprints, strength exercises and shooting practice.

Barcelona midfielder Frenkie de Jong said it was ”frustrating” to watch Madrid win the league.

”We have not played well this season and that is why we could not compete with them,” he said. ”I hope that next season will be different.”

Xavi Hernandez had never promised that he could make a Barcelona side that had lost Lionel Messi into an immediate title winner when he took over the club in November. But after a good run of wins earlier this year, Barcelona had slumped to three straight losses in the same season for the first-ever time at Camp Nou. The last collapse, a 1-0 defeat to lowly Cadiz, had provoked boos from the crowd.

On Sunday Depay controlled a long ball from Jordi Alba before firing home in the 25th minute. Busquets doubled the lead early in the second half after he collected a rebound and shot from just inside the area.

But what looked like a comfortable victory was put in doubt when Antonio Raillo slotted in a free kick by Salva Sevilla in the 79th.

Barcelona lost Gerard Pique, who was returning from injury, when he appeared to hurt a leg in the first half. He walked off the field when replaced by Eric Garcia.

Ansu Fati went on as a late substitute for the 19-year-old forward’s first minutes since he injured a hamstring on Jan. 21.

OTHER RESULTS

Real Sociedad’s hopes of finishing with a top-four spot took a blow after being held 1-1 at Rayo Vallecano. The Basque Country side remained in sixth place, which is good for a berth in the Europa League, at five points behind Atletico Madrid in fourth.

Substitute Radamel Falco finished off a shot by Alvaro Garcia that had hit the post in the 77th to cancel out Alexander Sorloth’s opener for Sociedad.

Granada got a stoppage-time goal from Luis Milla to snatch a 1-1 draw with Celta Vigo, while Pere Milla equalized with six minutes remaining to salvage Elche a 1-1 draw at home to Osasuna.

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