Obtaining a residency permit in Spain is necessary for anyone planning to live indefinitely, study and work in Spain. They must apply for a residence card within 15 days of arriving in Spain. Before arriving in Spain it is best to contact embassies and consulates in your own country. If you are planning a short stay (on a short-term contract perhaps) then you will be issued with a temporary residence card for the period required. Children under 18 years of age can be included on the parents' residence card.

European Union Citizens:

The legal requirements for EU citizens intending to reside in Spain are as follows:
EU citizens no longer need either a visa or work permit to establish themselves in Spain. They are allowed to remain for six months, by the end of which time they should be in possession of a residence card, (Residencia). Obtaining a residence permit in Spain, you must either have a job, or have proof of sufficient funds to support yourselves and your family. A fiscal number also needs to be applied for, but this is a mere formality, as, in the case of foreign residents, the numbers are identical.

Non-European Union Citizens:

Non-EU citizens, planning to live in Spain, need to apply for a work and residence permit (the worker), or a residence permit only (non-workers or dependants).

Citizens from the United States, and most South American countries, are allowed to visit Spain, as tourists, without any permit or visa, for a maximum of 90 days out of 180. Most other countries will require a tourist visa.

Work and Residence Permit:

Obtaining a residence permit in Spain to work, (Residencia) the employing company in Spain must first process the application, on behalf of the employee, in Spain. Once the authorities in Madrid have stamped the official job offer, this is then passed to the employee in the country of origin, or last legal residence, so that the visa application can be processed at the nearest Spanish Consulate. When the work permit is granted, the authorities notify the hiring company in Spain, as well as the Spanish Consulate where the visa has been applied for, and the employee can return to the consulate to collect the visa. The employee may now legally reside and work in Spain, even though the process is not yet complete: it may take a few more months and two trips to the police station before the final work and residence cards are obtained.

Residence Permit:

Non-workers or dependants need only apply for a residence permit in Spain, (Residencia). They initiate the process by first applying for a residence visa, at the nearest Spanish Consulate to them in their country of origin, or last legal residence. Dependants will usually do this when the person they are dependent on applies for their visa. Non-workers need to provide proof that they have sufficient funds to sustain themselves in Spain. Once this residence visa is granted, they may travel to Spain where they will then have to apply for the residence permit, which involves three visits to the police station, over a period of about 1½ - 2 months, until they obtain their final residence permit. The validity of a residence permit is linked to the employee’s work permit, or, for non-workers, to the funds they accredit.

How to register:

Within three months of arrival in Spain, application for a Residence Certificate must be made at the Foreigner's Office (Oficina de Extranjeros) or local police station in the province of intended residence. In some areas, an appointment can be made in advance.
The following documents are required in order to apply for a Residency Certificate:

* Valid passport or national identity card
* Signed application form EX16 (Solicitud de certificado de registro como residente o Tarjeta de residencia de familiar de ciudadano de la Union).
* Proof that the appropriate fee payment has been made (a bank-stamped Modelo 790 payment form).

If an NIE number has previously been assigned, take the certificate as proof of payment.
If all paperwork is in order, the residence certificate is issued immediately and is valid indefinitely. However, the relevant police or foreigner's office should be notified of any change to personal status (marriage, divorce, change of address) using the same form EX16 and following the same process.
The residence certificate is a piece of paper which contains the NIE number. It is not an identity document and the certificate should be carried with identification (such as a passport) at all times.