Spain is home to the largest concentration of British nationals living outside their country in the European Union, and many of them have watched the Brexit campaign with growing concern.
In a televised address, Prime Minister Mariano Rajoy said EU treaties governing Britain's ties with the rest of the bloc would remain in force while London negotiates the terms of its exit in a process he said could take “at least two years”.
During that time, nothing would change for Britons in Spain, nor for Spaniards in Britain, who would maintain the same rights they have enjoyed until now as EU citizens.
“Their rights to move freely, to work, to pay social security contributions, to receive pensions, to invest, to vote or be elected in local elections will not be affected at all,” he said.
“The same applies to the rights of British citizens who live or work in our country or in the rest of the EU.”
Officially, just over 283,000 Britons are residing in Spain, but many do not bother to register, with estimates suggesting between 800,000 to a million live in the country.
Whole swathes of Spain's southern coast have been transformed into little outposts of Britain with pubs and other shops catering to their tastes.
One of the EU's main tenets is the freedom of its citizens to live and work in any member state and be entitled to social security and health care.
Many Britons living in Spain fear they will lose these benefits when Britain leaves the 28-nation bloc.