There are five grounds that allow to obtain a Spanish citizenship:
Origins (place of birth) – automatic citizenship. When one of the parents has Spanish citizenship or an applicant as well as one of their parents was born in Spain.
Option of citizenship – an opportunity for foreigners to get citizenship if they are somehow connected with the country, for example have Spanish parents.
Naturalization – an option to get citizenship by any person who has strong grounds. For example, scientists, artists and etc.
Decision by the state – an option to become a Spanish citizen for those who have lived in the country for over 10 years and consider themselves as Spanish residents and fulfill their civic duties.
Living in the country for a certain period of time. In this case the ground is a long-term stay in Spain.
For many foreigners the easiest way to get Spanish citizenship is the last option in the list below. As a rule, you can apply for citizenship after 10 years living the country. But this term may be shortened to 5, 3 or sometimes event for 2 years.