Spain's government defended a plan to fight soaring unemployment by shutting the door on foreign workers, fending off criticism that the idea is mean-spirited and futile. Deputy Prime Minister Maria Teresa Fernandez de la Vega said Friday the government had no choice but to respond to the needs of the labor market. The Socialist government has been under fire from unions, immigrant advocacy groups and opposition parties since the labor minister announced this week the number of work visas granted abroad to people eager to take low-skill jobs in Spain “will get close to zero.” The minister, Celestino Corbacho, said Wednesday it did not make sense to keep recruiting workers in other countries when Spain has 2.5 million people unemployed, 500,000 more than in August 2007, largely as a result of a collapse in the construction industry. Corbacho is finalizing a separate plan to pay unemployed foreigners to go home - through lump sum payments of their jobless benefits - and stay there for a few years, with the right to come back when things get better. This all smacks of a big policy reversal for Prime Minister Jose Luis Rodriguez Zapatero, who has prided himself on being immigrant-friendly since taking office in 2004. Zapatero granted amnesty to 600,000 undocumented foreigners in 2005, angering other EU countries which felt this would lure waves of other illegal immigrants who could cross into France and elsewhere in the new border-free Europe. Spain's population of 45 million is now about 10 percent immigrant - compared to an insignificant proportion a decade ago - largely from Latin America, North Africa and eastern Europe. Immigrant labor is largely responsible for the millions of houses and other buildings that sprouted like mushrooms during Spain's economic boom of recent years. But Spain's economy has all but stagnated in less than a year, and gone from being one of the EU's top job-creators to having its highest jobless rate: 10.7 percent, according to Eurostat, the bloc's statistical agency. Fernandez de la Vega said hiring workers in their countries of origin has been part of a Spanish policy to regulate immigration and fight illegal entries, and always linked to the needs of the job market. “The government's goal in its immigration policy has not varied,” she told a news conference. “The only thing that has changed is the labor market.” The Labor Ministry says that under Corbacho's plan, foreigners who come to do seasonal work like picking strawberries or other produce would not be affected. Rather, the plan focuses on people who until now were granted open-ended contracts and did low-skill jobs like cleaning Spaniards' houses or working in shops for less than 1,000 euros ($1,4300) a month. Last year, nearly 180,000 foreigners were granted this kind of visa to work in Spain. Economists say that even if all those jobs had gone to unemployed people already in Spain - the goal of the Corbacho plan - it would barely make a dent in the jobless rate. “It is absurd, because among other things it would have a very limited impact,” said Sandalio Gomez of the IESE business school in Madrid. Alumdena Fontecha, an official of the General Workers Union, said Cormacho is linking Spain's economic woes to immigration, “as if that were the problem with unemployment.” “This is an irresponsible message,” she said Thursday.