Spain’s cabinet has approved measures for Britons in Spain to continue living there as now if the UK leaves the EU without a deal.
Foreign Minister Josep Borrell said the main purpose was that no-one, British or Spanish, would be left unprotected.
Spain estimates that the measures, which would become law under a no-deal Brexit, would grant residency rights to about 400,000 UK citizens.
UK MPs have so far rejected PM Theresa May’s withdrawal deal with the EU.
That raises the prospect of the UK leaving without a deal on 29 March.
More than 300,000 Britons are currently registered as residing in Spain, the government in Madrid says. There are at least 150,000 Spaniards currently residing in the UK.
Mr Borrell said the measures “of temporary nature” were aimed at protecting the interests of Spanish and British citizens as well as trade between the two countries.