Fatima Taleb, the first Muslim councilor in the Catalan city of Badalona. GIANLUCA BATTISTA / EL PAÍS

They came in droves, attracted by a booming economy. More than five million immigrants arrived in Spain between 1995 and 2005, changing the face of the country overnight and initially raising concerns of a possible xenophobic backlash or a rise of far-right political parties, as was the case in other European countries. But it didn’t happen.

Then, in 2008, the financial crisis hit and the Spanish economy went bust. Finding themselves out of a job, hundreds of thousands of migrants decided to return home. But many others have stayed in a country where almost a quarter of the workforce is idle and where competition for scarce subsidies and jobs is fierce.

We haven’t fallen into the French trap of assimilation, nor in the communitarian model of the United Kingdom” Esteban Ibarra, president Movement Against Intolerance

Spain is very much the exception in Europe: France, the United Kingdom, Germany, the Netherlands, Austria, Belgium, and the countries of the former eastern bloc have all witnessed the growth of anti-immigration parties. So why not Spain?

To start with, say the experts, the majority of migrants who came here did so during a construction boom, and they came to work. Migrants were well received because they fed the boom. What’s more, unlike in other European countries, those who came (mainly from Latin America and Romania) shared many cultural and religious traits with Spaniards.

Another reason is that Spaniards are able to identify with the immigrant’s position, probably much more so than say, a German or a Finn. In the 1950s and 1960s, millions of Spaniards went abroad in search of work, and now, the children of those men and women are repeating the process.

Esteban Ibarra, the president of the Movement Against Intolerance, says that Spain’s reliance on tourism has also made people here more open to foreigners. “A country that receives 65 million visitors a year has little choice but to be open and diverse,” he says.

But Ibarra says that perhaps more important are this country’s policies on integrating new arrivals. “We haven’t fallen into the French trap of assimilation, nor in the communitarian model of the United Kingdom, where each community lives in its own little world," he says. "In Spain, we have gone for multiculturalism. People live together, there have been a lot of mixed marriages, and that has been a good thing.”

This country’s live-and-let-live attitude was forcefully demonstrated in the aftermath of the March 11, 2004 terrorist attacks in Madrid, which killed nearly 200 people. The perpetrators were mainly Moroccans resident in Spain. But contrary to fears at the time, there were no major outbreaks of racism in the weeks and months that followed.

José Ignacio Torreblanca, who heads the European Council on Foreign Relations’ office in Madrid, agrees that Spain is the exception in the European context, noting that unlike in countries such as France or Sweden, there haven’t been any problems with integration. “In Spain, there is no discontent with immigration, and no electoral incentives for political parties, as there are in other countries.”

Torreblanca explains why the Spanish electoral system doesn’t favor anti-immigration parties: “There are certainly opponents of immigration in Spain, but the political parties are not competing with each other to represent these views. An anti-immigration party would have a hard time attracting votes. This could be due to the way the Spanish right is largely grouped in a single party [the Popular Party], as well as an electoral system that punishes new parties. In countries with proportional election it is easier for these kinds of parties to appear.”

He cites the case of Vox, which emerged a couple of years ago with the aim of representing voters to the right of the PP, but which did not manage to win a single seat in the European Parliament. The emergence of two new parties, Podemos on the left, and Ciudadanos on the center-right, makes it even less likely that an anti-immigration party could find any space in the Spanish political spectrum, given that these two new forces have largely captured disgruntled voters.

The average Spaniard is unaware that immigrants are taking away our constitutional rights” Rafael Ripoll from anti-immigration party España 2000

Rafael Ripoll, a councilor in the Madrid dormitory town of Alcalá de Henares for España 2000, an anti-immigration party that hopes to become Spain’s answer to France’s National Front, knows too well the difficulties he faces. “At present, Podemos and Ciudadanos dominate the political scene. The idea of ‘Spaniards first’ has been totally pushed aside,” he accepts. In his opinion, parties like his have failed to capture votes because “the average Spaniard is unaware that immigrants are taking away our constitutional rights. It could be a question of our national character, or it could be because of our recent history.”

Ripoll mentions what may arguably be the main reason Spaniards are not interested in the far right: the 40-year military dictatorship that followed a devastating civil war. This is especially true among the older generations.

That said, things can change, and this year marks the 40th anniversary of the death of General Francisco Franco. As the economic crisis slowly draws to an end, the fight for jobs and subsidies is intensifying, and it might be that just when it seems this country has left the worst behind it, the fragility of the Spanish miracle is exposed.