When immigrants come to L'Hospitalet on the grimy outskirts of Barcelona, they'd better not play loud music after 10 at night or spit on the street.

"You are not allowed to spit, urinate or defecate in public places," says a leaflet in Spanish and Catalan aimed at the immigrant community, which has increased tenfold in nine years to reach 24 per cent of the dormitory town's population of 263,000.

As the country lurches towards possible recession following a boom fuelled by immigrant labour, the leaflets distributed on the streets of densely inhabited working-class L'Hospitalet confirm that a hardening of attitudes to immigration, already apparent in other parts of Europe, is now reaching Spain.

At the town hall, run by a Socialist-led coalition, officials talk about "disciplining" immigrants to avoid frictions with native Spaniards, and describe how they have taken measures including a special police unit which mainly concentrates on complaints about noise.

Compare that with an amnesty for 700,000 illegal immigrants announced by Socialist Prime Minister Jose Luis Rodriguez Zapatero soon after he first took office in 2004. During election campaigns this year, he accused the conservative opposition of racism when it called for stricter immigration controls.

Now Zapatero has surprised many of his own supporters by poaching L'Hospitalet's mayor to become his new immigration minister.

The opposition Popular Party made inroads in working-class neighbourhoods at the March ballots, and Mr Zapatero decided the rate of immigration, which had touched 800,000 a year, was becoming an electoral liability as the economy entered a steep downturn.

The arrival of large numbers of migrants in a country long more accustomed to exporting people than importing them has changed the complexion of Spain at lightning speed, taking the proportion of foreigners from nearly nothing to 10 per cent.

But once installed as new minister for immigration, the former mayor of L'Hospitalet, Celestino Corbacho, delivered immediate changes in both policy and tone.

"Can Spain take in everyone? The answer is no," Mr Corbacho said soon after taking his new job.

While still insisting that Spain needed properly qualified immigrants for its future growth, he proposed paying unemployed foreigners to return in a "programme of voluntary return". He also said he wanted to limit family reunion visas to spouses and young children, a move he said would cut immigration by 40 per cent.

Thanks to opposition backing, Mr Corbacho's proposals are likely to be approved by parliament later this year.

Spain has also supported a controversial new EU rule allowing illegal immigrants to be detained for up to 18 months, although it says it will not itself implement it.

A rush of Africans trying to sail to the Canary Islands had already led Mr Zapatero to take a harder line on illegal immigration, but Mr Corbacho's stance marked a radical switch from the first term, when one senior government official said Spain could easily take another 20 million foreign arrivals.

Immigrant groups have reacted angrily.

"Foreigners are being used as scapegoats at a time of economic crisis," said migrants' rights lobby group SOS Racismo in a statement, calling Mr Corbacho's proposals xenophobic.

Without immigration the economic bonanza which transformed Spain over the 13 years to last year would not have taken place. It was cheap labour from Morocco, Latin America and Eastern Europe that built the country's immaculate highways and millions of new homes, hundreds of thousands of which now stand unsold.

But the cheap money which made this possible has now disappeared, and unemployment has jumped by 400,000 in one year to near 10 per cent. Among immigrants, joblessness is now around 15 per cent and heading higher as construction grinds to a halt.

"How are we to find new jobs for all those immigrant workers, who are people with low qualifications?" said Rafael Pampillon, head of the economics department at Madrid's Instituto de la Empresa business school.

"Spanish economic growth has unfortunately been based on labour-intense sectors, on low-skilled workers and low productivity, as is the case with construction," Mr Pampillon said.

"Growth has been unbalanced, which has generated inflation and a very big current account deficit dependent on foreign financing," he said.

Spain's current account deficit at about 10 per cent of GDP is the world's second-largest in nominal terms, beaten only by that of the US. Inflation has consistently been markedly higher than the euro zone average and is now running at five per cent.

But immigrants say they are not just economic pawns to be returned when no longer needed.

Raul Jimenez, of Ruminahui, a group which represents Ecuadoreans living in Spain, said he was saddened to note that Mr Corbacho was made minister for both immigration and labour.

"The government only understands immigration in terms of a workforce, not as people," said Mr Jimenez.

"Immigrants here know they've helped the country become richer, and they are still working in key sectors like construction - but hearing these statements about 'voluntary return' makes them feel unwelcome," Mr Jimenez added.

The sudden influx of migrant workers, much younger than the native Spanish population, required big investments in infrastructure including schools, which had been closing and had to be reopened.

When he was mayor of L'Hospitalet, Mr Corbacho also pressured migrants to conform to Spanish customs, and said immigration had made citizens more worried about crime.

"Solidarity has its limits and so do resources," said Maria Dolores Fernandez, in charge of L'Hospitalet's Social Welfare Department, adding the city now had a bigger migrant population than it could properly assimilate.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.