Spain has started to legalise 500,000 undocumented migrants and give them the immediate right to work in a move “to fight against the advance of the far-Right”.

Madrid officially began the process on Tuesday after a last-minute deal between the ruling Socialist party and the Left-wing Podemos party, which has propped up Pedro Sanchez’s minority government since elections in 2023.

A government spokesman said: “We not only intend to remain a beacon, but I want to believe that we will be a seed and a germ to fight against the advance of this far-Right wave that is trying to gain ground, and against which we will do everything in our power to stop it.”

Podemos said the legislation would help dismantle “institutional racism that only fuels exploitation and racist hatred”, while the government cast the move as a political challenge to the Right-wing Vox party, which has been steadily rising in the polls.

Under the scheme, undocumented immigrants, asylum seekers, or those who have been living in Spain for more than five months by Dec 31 2025, will be eligible to apply for legal status between the beginning of April and June 30 this year. Applicants with criminal records will be excluded. Applications will be assessed within 15 days, after which successful candidates will be allowed to work “in any sector and anywhere” in Spain, according to Elma Saiz, the migration minister. Santiago Abascal, the leader of Vox, accused the prime minister of seeking to “replace” the Spanish population through mass migration.

“He intends to … accelerate the invasion. We must stop him. Repatriations, deportations, and remigrations,” he said.