A person can apply for Spanish citizenship after having resided in Spain for a certain amount of years.
TEN years of continuous and legal residence are the general rule of what is required.
FIVE years are sufficient for those who have obtained refugee status and
TWO years in case of nationals of origin from Ibero-American countries, Andorra, the Philippines, Equatorial Guinea or Portugal, or Sephardic jews (depending on renovation of the corresponding law).
ONE year in the following cases:
A person who was born in Spain.
In case the person could have opted for Spanish nationality.
A person who was the ward of a Spanish citizen or institution for two consecutive years, even if they continue in this situation at the time of the application.
Anyone who at the time of application has been married to a Spanish citizen for one year and is not legally or de facto separated.
The widow or widower of a Spaniard, if at the time of the death of the spouse there was no legal or de facto separation.
A person born outside Spain to a father or mother, grandfather or grandmother, who were originally Spanish.
In all cases, the residence must be legal, continuous and immediately prior to the request.