The EU Residence Card
As of March 2007 EU citizens no longer require an EU Residence Card.
However,
Non-EU/EEA Citizens: Any non-European Union citizen staying in Spain for a period longer than three months requires a Residence Card (Tarjeta de Residencia) residency permit.
The Ministry of Territorial Policy (Ministerio de Politica Territorial; also known as the Ministerio de Administracións Públicas - MAP) has a website with comprehensive information in English regarding how to apply for the appropriate documents.
Any EU citizen intending to stay in Spain for more than three months is obliged to register to be added to the Central Register of Foreign Nationals (Registro Central de Extranjeros) at a Foreigners Office (Oficina de Extranjero) or local police station (Policia Nacional) if there is no foreigner's office in the area in which they intend to reside.
All foreigners must have a foreigners tax identification number (Numero de Identificatión de Extranjero - NIE), regardless of whether they are obliged to have a residency permit or not. The NIE is both a Social Security number and a tax identification number. Applications for an NIE can be made at a local police station which has a foreigners department, or by contacting the local regional government; either in person or through a representative. The number appears on all documents issued in Spain.
An NIE is required by anyone with financial, professional or social interests in Spain. It is also essential when buying property, opening a bank account, starting a business, using short-term employment agencies or arranging receipt of social security benefits.