Visas and Embassies
Citizens from countries that are a members of the Schengen agreement don't need to have a passports or visas to enter Spain. The valid ID card will suffice.
People who are from countries that not participate in Schengen should have a valid passport to come to Spain.
However, if you want to stay in Spain more than 3 months you will need to apply for a residence card.
The members of the Schengen agreement: Austria, Belgium, the Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Italy, Latvia, Lithuania, Luxembourg, Malta, the Netherlands, Poland, Portugal, Slovakia, Slovenia, Spain, Sweden, Iceland and Norway (Iceland and Norway aren't European Union members).
Check also the nearest embassies and consulates in Spain: