Spain’s embattled Prime Minister Pedro Sánchez is introducing an emergency decree to protect the rights of Britons in Spain and Spaniards in Britain after the UK leaves the European Union.

The decree will be approved by the Spanish Cabinet on March 1, as the clock is ticking both for Spain – which goes to the polls on April 28 – and for the UK, which is due to leave the EU on March 29 with or without a Withdrawal Agreement.

The Spanish government is moving to extend local legal rights to UK nationals unilaterally, in anticipation of British reciprocity.

“Safeguarding the rights of Spaniards in the UK is fundamental for the government of Spain,” Sanchez told the Cortes, Spain’s parliament, on February 28.

British Prime Minister Theresa May has agreed on a Withdrawal Agreement with the European Commission and the EU-27 but has failed to pass it through parliament, a situation that has left many unanswered questions as to the status of EU citizens living in Britain and UK citizens in the EU.

The Withdrawal Agreement envisages the UK overseas territory of Gibraltar leaving the EU, although “the Rock” voted overwhelmingly to remain in the bloc in the 2016 referendum on EU membership.

Spain and the UK have signed four Memorandums of Understanding that cover cooperation in the fields of environment, taxation, cross-border workers, and land reclamation for Gibraltar.