A packet of cigarettes is enough to cause a fight among the Spaniards and immigrants shivering in the dark outside an emergency homeless shelter in Madrid, set up for a bitter winter and depression-era unemployment.

Police rush in, pushing past jobless Romanian and Hungarian construction workers in flimsy denim jackets. They break it up.

"One day this place is going to explode," says unemployed waiter Miguel Roa, a Spaniard. Since December, he has lost his job and his home as well as seeing his family split as economic crisis ended 14 years of growth in Spain.

The unemployed are becoming homeless and eating in soup kitchens in Spain, where the global economic crash put a million out of work last year, a figure not seen in any European country since the 1930s, according to Spanish newspaper El Mundo.

Spain offers an extreme example of problems brewing across Europe as economies face unprecedented strains from the implosion of a prosperity built on easy money and millions of low-skilled service jobs, many of them held by immigrants.

Its government is walking on egg-shells as it tries to keep a grip on spending and raise economic competitiveness without provoking violent demonstrations such as those in Greece, Bulgaria, Latvia and in pockets elsewhere.

Spain was one of four eurozone countries warned in recent days by ratings agency Standard & Poor's of a possible cut to its "AAA" credit status as the outlook weakens. The agency cut Greece's rating last Wednesday, and has warned Ireland and Portugal.

The eurozone's fourth largest economy must grapple with the costs of welcoming five million immigrants in the last decade, more than any other European country, to do jobs that no longer exist since housing and credit booms collapsed.

Foreigners outnumber Spaniards more than two to one in the chilly, prefabricated government shelter in Vallecas, Madrid, where the stench of body odour mixes with the sickly sweet smell of alcohol, tobacco and disinfectant. Most immigrants say they do not want to go home to eastern Europe, Africa or Latin America after living well in Spain.

"We don't have work in Hungary either, and at least here you won't go hungry," said Sandor Puruczki, 31, a qualified cook and welder from Salgotarjan, who is looking for work across Spain. Friction is growing as Spaniards and immigrants compete for a shrinking number of jobs at ever lower wages, said the Spaniard, Mr Roa: "Every day there is more tension".

Over a million more workers are expected to be laid off in Spain by next year, taking the total above four million, according to the Funcas savings bank consultancy. That would be far more than Germany, which has a population nearly twice as large.

Like other countries, particularly the US, Britain and Ireland, Spain is struggling to wean itself off foreign financing and contain a property crash.

But unlike its European rivals, Spain has no strong financial or technology sectors to fall back on. It has no substitute for a construction-driven, labour-intensive economic model that created 8.5 million jobs in the last 13 years.

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.