The British and Spanish governments have signed a bilateral agreement to allow British residents in Spain and Spanish residents in the UK to continue to vote in municipal elections after the UK leaves the EU.
The agreement, the first of its kind that the UK has reached with an EU country, was signed on Monday morning in Madrid by the secretary of state for the EU, Marco Aguiriano, and the British undersecretary of state for the Department for Exiting the European Union, Robin Walker.
The document will allow the 300,000 British residents in Spain - and the more than 175,000 Spaniards in the EU - to continue to vote in local elections as they have been doing until now as EU citizens.
"Although the UK is preparing to leave the EU, we will still be a European country and we value the contributions of all Europeans to our country and our democracy, wherever they come from," said Walker, who hopes to sign more agreements of this kind with other EU countries in "the coming weeks and months".
Both stressed that the agreement is part of both governments' efforts to preserve citizens' rights after Brexit.
The agreement will come into force the same day that the UK leaves the EU: 29 March if Brexit goes ahead according to schedule. This means that Spanish residents in the UK will be able to vote in the British local elections on 2 May, and Britons living in Spain will be able to take part in the municipal vote on 26 May.
The agreement will also mean that British residents can stand for election as councillors.
"With this agreement, one day we could have a Spanish mayor of London," joked Aguiriano, after highlighting the British capital's "diversity".
In order to vote on 26 May British residents in Spain still have to register on the electoral roll before 30 January if they haven't already done so.
However for future elections, article 3 establishes that British nationals must have been legally resident in Spain for three years uninterruptedly.
The UK joins the list of other countries whose residents can vote in municipal elections in Spain - and vice versa - thanks to special bilateral agreements. The others include Bolivia, Cape Verde, Chile, Colombia, South Korea, Ecuador, Iceland, Norway, New Zealand, Paraguay, Peru and Trinidad and Tobago.