MADRID — Girona earned a shock victory over Real Madrid that was celebrated by many throughout Catalonia on Sunday.

The small Catalan club stunned Madrid, the team of the Spanish establishment, with a 2-1 come-from-behind win in the Spanish league — just days after the wealthy northeastern region declared independence to heighten tensions in a dispute with the central government.

Pro-independence politicians were quick to celebrate.

“Girona’s victory over one of the great teams in the world is an example and a reference for many situations,” tweeted Catalan leader Carles Puigdemont.

It was Madrid’s first trip to Catalonia since Spain’s political crisis escalated. The match was played after hundreds of thousands of Catalans took to the streets of Barcelona to voice their opposition to the unilateral declaration of independence. Catalonia’s political leadership was fired by central authorities in Madrid who are trying to tame the worst political turmoil Spain has seen in decades.

“Today, all of Spain and a great part of the world saw that a small team can achieve anything in this great game of football when it does things well, when it has ambition and pride,” Girona coach Pablo Machin said.

The result left Madrid eight points behind Spanish league leader Barcelona, which on Saturday won 2-0 at Athletic Bilbao for its ninth victory in 10 league matches.

Second-place Valencia, which won 2-1 at Alaves on Saturday, is four points off the lead.

“We can still overcome this,” Real Madrid coach Zinedine Zidane said. “We will have better days and our rivals will eventually lose points.”

Despite security concerns ahead of the Spanish capital team’s visit to Girona, a city filled with separatist sentiment just north of Barcelona, there were no major incidents before, during or after the game.

Several pro-independence flags were on display at the small Montilivi Stadium, and the crowd sang “freedom” chants, but nothing disrupted the match. A few Real Madrid supporters could be seen mixed with the local fans in the stands.

Most in the crowd of nearly 14,000 were on their feet throughout the final minutes, and celebrated loudly when the final whistle was blown.

Girona, in its inaugural season in the first division, played well from the start, keeping Madrid from imposing its game.

It almost opened the scoring just before Madrid’s first goal in the 12th minute, when Pablo Maffeo’s shot struck the far post. The Madrid defense picked up the rebound and started a quick counterattack which culminated with Isco scoring a few seconds later after Cristiano Ronaldo’s shot was partly saved by goalkeeper Yassine Bounou.

The hosts turned the match around with quick goals early in the second half. Veteran striker Christian Stuani equalized with a low shot from inside the area in the 54th, and Portu netted the winner four minutes later from close range. Replays showed that Portu was slightly offside.

“We struggled a lot,” Madrid midfielder Casemiro said. “It’s a complicated moment, but we have to stay calm. We need to start playing better, we need to work harder.”

Lucas Vazquez had a goal disallowed for offside in the 83rd.

Girona, 12th in the standings with 12 points, had already hit the post in the first half.

Girona made a promising start to its top-flight debut, earning a draw against Atletico Madrid and a win at Malaga to give fans hopes of a successful season, but it went on a six-game winless streak until defeating Deportivo La Coruna last week.


FIRST WIN

Midfielder Recio converted an 83rd-minute penalty kick and Malaga defeated Celta Vigo 2-1 for its first win in 11 matches this season.

Malaga left the bottom of the standings with the win, moving a point above Alaves.


BACK TO VICTORY

Striker Jorge Molina scored with an 85th-minute penalty kick to give Getafe a 2-1 home victory over Real Sociedad, snapping the club’s four-game winless streak.

Both teams are in the middle of the table.


LOST LEAD

Mid-table Levante relinquished a two-goal lead in a 2-2 draw at struggling Eibar, which hasn’t won in seven matches.

__

More AP Spanish soccer coverage: https://apnews.com/tag/LaLiga


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