Spain 's move follows an immigration amnesty begun last year that granted nearly 8,00,000 new residence permits and moved thousands of undocumented workers out of the country 's underground economy .