BARCELONA, Spain — Quique Setién had Lionel Messi to thank for ensuring he made a winning start as Barcelona’s new coach.

The club’s all-time leading scorer finally broke down a stubborn Granada after the visitors were reduced to 10 men to secure a 1-0 win at Camp Nou on Sunday.

Granada had kept Barcelona in check and hit the post in its best scoring chance moments before Germán Sánchez was sent off with 20 minutes to play after getting a second yellow card for fouling Messi.

A hole then appeared in the visitors' defence which Messi exploited by passing to Antoine Griezmann inside the area. Griezmann quickly squared the ball for Arturo Vidal, who used his heel to roll it on for Messi to slot into the corner of the net for the 76th-minute winner.

Setién, who last coached at Real Betis, was hired by Barcelona on Monday after it fired Ernesto Valverde following a loss in the Spanish Super Cup semifinal to Atlético Madrid.

“I am happy. ... We did many things well and I hope to go forward improving little by little,” Setién said.

“(Messi) did what he has been doing all his life. There are games like this when you are missing your finishing touch or are not inspired in attack, when he always appears. We know that when the ball reaches Messi’s feet there is a very high probability it is going in the net.”

Barcelona stayed ahead of Real Madrid on goal difference. Both teams are eight points ahead of third-place Atlético Madrid after 20 of 38 rounds.

Messi took his league-leading tally to 14 goals this campaign.

With Barcelona at the top of the league, the rare midseason coaching change was seen by many fans as an attempt to recover the attractive passing attack that had waned in recent seasons. Setién declares himself an admirer of soccer great Johan Cruyff, who established Barcelona’s style as a coach in the 1990s.

PATIENT GRANADA

Granada, promoted at the end of last season, shocked Barcelona 2-0 at home in September.

At Camp Nou on Sunday, Barcelona dominated possession and weaved together long passing buildups from the start. Granada, however, showed discipline and patience in defence and was well positioned to limit scoring chances by the hosts until late on.

In the first half, Granada goalkeeper Rui Silva only had to save a seventh-minute shot from Ansu Fati, who started in place of injured Luis Suárez.

Messi, who made Granada’s defence scramble to keep up with his runs, came close before halftime after combining passes with Jordi Alba, but shot wide.

Granada mustered its only threat well into the second half when Yan Eteki almost surprised goalkeeper Marc-Andre ter Stegen after recovering the ball and hitting the post from distance in the 66th.

But Granada’s hopes for an upset took a blow four minutes late when Sánchez was sent off after earning a second booking for a tackle on Messi.

VALENCIA SHOCK

Croatian striker Ante Budimir scored twice as Mallorca moved out of the relegation zone with a 4-1 win against 10-man Valencia in a match played under rainy conditions.

It was Mallorca's first win in seven rounds and its biggest victory since it was promoted to the first division this season.

After Antonio Raíllo opened the scoring, Budimir steered in another goal in the 22nd before capping a Mallorca buildup of one-touch passes in the 41st for a 3-0 lead.

Valencia’s Dani Parejo was sent off for a second booking in the 51st. Mallorca's Dani Rodríguez struck from long range before Ferran Torres got Valencia’s consolation goal.

“It’s a lopsided loss and the team is not giving out good vibes,” Valencia coach Albert Celades said. “We will have to draw our conclusions for the future.”

Valencia is in seventh place after its first loss in six rounds. The defeat at Mallorca came after it lost to Real Madrid in the semifinals of the Spanish Super Cup.

Sunday saw rain over large areas of eastern Spain and its Balearic Islands, of which Mallorca is the largest.

LIFELINE FOR ESPANYOL

Espanyol hung on for a 2-1 win at Villarreal and ended a run of nine rounds without a victory that dated back to October.

David López and new signing Raúl de Tomás, who made his league debut, scored with headers for Espanyol. Santiago Cazorla converted a penalty for Villarreal.

Espanyol remained in last place but climbed to within four points of safety after a second consecutive match taking points under new coach Abelardo Fernández.

Espanyol drew 2-2 with Barcelona in Abelardo’s debut last round and beat a third-tier side in the Copa del Rey before the victory at Villarreal.

OTHER RESULTS

Midtable Real Betis beat sixth-place Real Sociedad 3-0 at home thanks to goals from Borja Iglesias, Joaquín Sánchez, and Sergio Canales.

Athletic Bilbao was held 1-1 at home by struggling Celta Vigo.

___

More AP soccer https://apnews.com/Soccer and https://twitter.com/AP_Sports