The Spanish government has launched a programme granting legal amnesty to up to 800,000 undocumented immigrants.
Thousands have been trying to get their paperwork in order
Applicants who can prove they arrived before last August, have a job contract and no criminal record, have three months to sign up as taxpayers.
The authorities say the move will draw immigrants out of the black economy.
Spain has rejected criticism from the opposition and other European countries that the amnesty makes the country a gateway for illegal immigrants.
Spanish officials are already preparing to deport a group of 227 suspected illegal migrants found on a boat drifting off the Canary Islands on Saturday.
Within Spain, the amnesty has meant tens of thousands of people across the country have been queuing at embassies and local council offices to prepare their documents.
Now they have three months to submit their forms. Under the rules, an immigrant with a six-month work contract who is registered at the town hall and social security office is eligible for Spanish residency, the right to live and work legally in Spain.
Spain polices its coasts against illegal immigrants from Africa
Socialist MP Rafael Estrella told the BBC: "We have a number of illegal immigrants in Spain who are not contributing to the system, to the social system, with their taxes and who have been working here on an irregular basis where they are exposed to the mafias (illegal gangs)."
The scheme is expected to bring in millions of euros of tax revenue usually lost in the black market.
It is estimated that more than one million people live and work in Spain illegally - thousands in two of Spain's most important industries: agriculture and construction.
The BBC's Danny Wood in Madrid says that without any legal status, they form the most vulnerable layer of Spanish society.
Immigrant groups say this legal amnesty lacks flexibility and is not the way to solve Spain's immigration problems.
EU 'green card'
The Spanish plan contrasts sharply with schemes brought in by other EU members.
On Monday the UK government unveiled a new points system designed to tighten immigration controls and ensure migrants wanting to work in the UK have the right skills.
The BBC's Oana Lungescu in Brussels says the two plans highlight the lack of co-ordination over immigration policy within the 25-nation European Union.
Earlier this year, the European Commission argued that with a rapidly ageing population, Europe urgently needed more economic migrants in order to catch up with its global competitors.
Among the solutions proposed was the introduction of a US-style "green card", giving an individual the right to work throughout the EU.
By the end of the year, the Commission intends to consult employers, trade unions, non-governmental organisations and countries where most migrants come from, in order to present an integrated policy plan for legal migration.