Registration in the Consulate of your country

 

In the first days after your arrival, please contact the Consulate or Embassy of your home country. Register there as a citizen that is living abroad.

You could need that i.e. if you want to vote while you are in Spain, and also for security reasons.