The Verdict: Need More Info
Time on a student stay does not count towards Spanish nationality, so your clock has not started. Switch to a work or other residence permit as early as the rules allow; the clock starts that day.
Spanish law treats a student permit as a stay, not residence, and the courts have consistently held that study time counts for nothing towards naturalisation. The 2024 regulation renamed the permit and eased conversion, but did not change that.
Since May 2025 a student can move to a work and residence permit without leaving Spain, and self-employment routes are open too.
After you switch, the wait is two years for nationals of origin of Latin American countries, Andorra, Portugal, the Philippines and Equatorial Guinea, and ten for everyone else.