The general rule is ten years of legal and continued residency, but most of the people who ask aren’t covered by the general rule. Depending on your nationality, your family situation, or where you were born, the period can drop to five years, to two, or even to one.
There’s also a second question that decides as many files as the first: not all the time you’ve spent in Spain counts. The Civil Code requires legal residency, and the law draws a distinction between residing and merely staying. The most frequent and most painful case is that of students, who discover after years in the country that their clock hadn’t started running yet.
Here you have the periods for each scenario, which types of authorization actually count, how long you can be away from Spain without breaking continuity, what other requirements you have to meet, and what the complete process costs.
The Residency Periods, Scenario by Scenario
Article 22 of the Civil Code sets four periods according to the applicant’s profile:
| Period | Who it applies to |
|---|---|
| 10 years. | General rule for all other nationalities. |
| 5 years. | People with recognized refugee status. |
| 2 years. | Nationals of Ibero-American countries, Andorra, the Philippines, Equatorial Guinea, and Portugal, and people of Sephardic origin. |
| 1 year. | Those born on Spanish soil, married to a Spanish national, widowed from a Spanish national, born outside Spain to a father, mother, grandfather, or grandmother who was originally Spanish, those who did not exercise their right of option in time, and those who have been under the guardianship, custody, or foster care of a Spanish citizen or institution for two consecutive years. |
The two-year period is the one most people benefit from, because it reaches all of Latin America. And watch the detail about nationality by origin: you have to be a national by origin of those countries, not someone who acquired that nationality later on.
The one-year period through marriage has conditions of its own that are worth knowing before you start counting months, and we develop them in the guide to Spanish citizenship by marriage: the marriage must be registered, there can be no legal or de facto separation, and you have to prove that you actually live together.
What Counts as Legal Residency (and What Doesn’t)
This is the point where the most files are lost. The Civil Code speaks of residency, and the Immigration Act draws a clear distinction between a stay and residency. Only the second one counts.
Time counts with:
- A temporary residence authorization, whether initial or renewed, with or without work.
- Long-term residency.
- An EU family member card and EU registration certificates.
- Authorizations for exceptional circumstances, including every category of arraigo.
- Authorizations under the Entrepreneurs Law, such as the highly qualified professional permit or international telework.
Time doesn’t count with:
- A student stay. This is the settled criterion of the Directorate-General for Legal Certainty and Public Attestation, backed by the National Court and the Supreme Court: a student stay is not residency for the purposes of Article 22.
- Short-term stays and periods as a tourist.
- Time spent in irregular status, even if you were registered with the municipality and documented.
- Periods with an expired authorization and no renewal in process.
An example we see every academic year: a Colombian student arrives on a study visa, completes a bachelor’s degree and a master’s, and adds up five years in Spain. When she asks about citizenship, she discovers that her clock is at zero. Her two years begin the day she is granted a residence authorization, for instance after modifying her status once her studies are over, a step we explain in detail in the guide on how to change a student visa to a work permit in Spain.
The practical conclusion for any international student is simple: the sooner you convert the stay into residency, the sooner the time that genuinely brings you closer to the passport starts counting.
Continued and Immediately Prior: How Much You Can Be Away from Spain
Article 22 requires the residency to be legal, continued, and immediately prior to the application. Those three words mean three different things:
- Legal: with a valid authorization throughout the whole period.
- Continued: without having moved your habitual residence outside Spain.
- Immediately prior: the period must run right up to the moment you file the application, and your card must be valid that day.
On absences there’s no figure in the law, and anyone who gives you an exact number is oversimplifying reality. The Supreme Court has established that leaving Spain doesn’t in itself break continuity, provided the absences are occasional, justified, and don’t involve moving your home abroad. The Administration, however, tends to focus on continuous absences of more than three or six months and frequently denies those files, which are later won on appeal by providing the justification.
Translated into decisions: if you’ve spent five months abroad caring for a sick relative, keep the medical reports, the tickets, and everything that proves the reason and your continued ties to Spain. If you’ve spent two years working in another country, the problem is different, because there really was a change of residence.
The Other Two Requirements You Have to Meet
Time is necessary but not sufficient. The grant also requires:
Good civic conduct. It’s evidenced with criminal record certificates from Spain and from your country of origin, but the concept is broader than the absence of convictions: the Administration assesses overall behavior, and files with serious penalties or relevant breaches can fail even where there’s no criminal conviction.
A sufficient degree of integration. It’s proven with two Instituto Cervantes exams:
- The CCSE, the test on constitutional and sociocultural knowledge, mandatory for all adult applicants. Its certificate is valid for four years.
- The DELE A2 or higher, from which nationals of countries where Spanish is an official language are exempt. Its diploma doesn’t expire.
Minors and people whose legal capacity has been modified by court order are exempt from both tests. And a scheduling tip: register for the exams well in advance, because the sittings have fixed deadlines, and waiting until you have all your documents ready only to remember the CCSE at that point can delay the application by several months.
What It Costs and How Long It Takes
The application fee is 790 code 026, at 104.05 euros, paid once before filing the file and also payable for each minor who applies. Its amount is updated through the Budget Acts, so it’s worth generating the payment slip from the Ministry of Justice’s electronic office at the moment of paying and not reusing an old one.
To that you have to add the Instituto Cervantes exams, which come to around 200 euros in total when you have to take both, and the documentary costs: a legalized or apostilled birth certificate, criminal record certificates from your country of origin, and sworn translations when the documents aren’t in Spanish. These last ones are usually the largest item in the process for anyone coming from outside the European Union.
As for the timelines, the procedure has a legal resolution period of one year from the entry of the application, and if it passes with no answer, negative silence operates, which opens the way to an appeal. The real timelines vary a great deal depending on the phase where the file gets stuck, and we analyze them in detail in the guide on how long Spanish citizenship takes.
Routes That Don’t Depend on Residency Time
Not everyone needs to count years. There are three paths that work on a different logic:
- Citizenship by option. For children of Spanish nationals, people who were under the parental authority of a Spaniard, and other defined scenarios. It requires no prior residency and its processing is faster, as we explain in our Spanish citizenship by option service.
- Carta de naturaleza. A discretionary grant by the Government on grounds of exceptional circumstances. It can’t be planned for or claimed as a right.
- The Democratic Memory Law. The well-known grandchildren law closed its application window on October 22, 2025. Anyone who filed in time keeps their file in process; anyone who didn’t can no longer use this route.
One nuance about Sephardic applicants that causes confusion: the special route that allowed citizenship to be obtained without residing in Spain ended in 2019, but the reduced two-year period of the Civil Code for people of Sephardic origin who do reside legally in the country remains in force.
Knowing how many years you need is only half the answer. The other half is checking that the time you’ve already accumulated actually counts, and that review is best done before paying fees and exam registrations, not after a denial. At ILLAY Legal we analyze each person’s complete history: what authorizations they’ve held, which periods count, how their recorded absences affect the file, and the exact date on which they can apply with confidence. We are immigration advisors in Spain and we handle the complete file fully online through our Spanish citizenship by residency service, from the preliminary assessment to the oath and the registration. Tell us your nationality, what cards you’ve held, and since when, and we’ll tell you when you can apply.
Frequently Asked Questions About How Long Do You Have to Live in Spain for Citizenship?
Does the time I spent in Spain as a student count?
No. A student stay is not legal residency for the purposes of Article 22 of the Civil Code, and that criterion is settled both in administrative practice and in the courts. Your count begins when you obtain a residence authorization, normally when you modify your status after finishing your studies. It’s the most expensive mistake international students make, because they usually discover it when they think they’ve completed the period.
Do the years spent in irregular status count if I was registered with the municipality?
No. Municipal registration proves presence, not legal residency, and they’re different things. That time does serve another very important purpose: proving the two years of presence that arraigo requires, which is precisely the route for moving from irregular status to a residency that does count toward citizenship.
How many months can I be outside Spain without losing the count?
The law doesn’t set a number. The Supreme Court’s criterion is that occasional, justified absences don’t break continuity as long as you don’t move your habitual residence out of the country. In practice, the Administration examines continuous departures of more than three or six months closely, so if you’ve had long absences it’s worth documenting the reason and keeping your ties to Spain evidenced: work, housing, family, and economic activity. Many denials on this ground end up being overturned on appeal when the justification is well built.
Do I have to renounce my current nationality?
The general rule requires renouncing your previous nationality at the oath ceremony, with one very broad exception: nationals of Ibero-American countries, Andorra, the Philippines, Equatorial Guinea, and Portugal, along with Sephardic applicants, keep theirs. In addition, many countries don’t recognize that renunciation under their own law, so in practice the person keeps both passports. The nuances are in the guide on dual Spanish nationality.
Can I apply if my card expires in two months?
Yes, as long as it’s valid on the day you file, but it’s advisable to have the renewal underway. The residency must be immediately prior to the application and the file takes months to be resolved, so being left without an authorization during processing complicates the procedure.
Do my children get citizenship when it’s granted to me?
Not automatically, but through a much shorter path. Minor children under your parental authority can opt for Spanish citizenship once you acquire it, a procedure of its own and considerably faster than the residency one. For those born in Spain to foreign parents there’s also the reduced one-year period. That’s why it’s worth planning the family order from the start: who applies first and when the rest come in can mean years of difference for the whole family.


