This page is an advisory page only and represents our understanding of the current legal and business situation. Advice and opinions expressed here should never be used as a replacement for professional advice.
Spain is divided into several semi-autonomous regions (e.g. Galicia, Andalucia). There are nationally applicable laws laid down by the government, but each regional government can introduce laws (or more properly "regulations") applying to their region. On top of this, there are "ayuntamientos" or town councils which have power to introduce further regulations in their administrative area.
These latter can sometimes conflict with regional regulations. At time of writing, there is a very serious situation in the Marbella area whereby properties built with the permission of the ayuntamiento are in conflict with the regional planning laws and demolition orders are being proposed. This is particularly disturbing for owners because they thought everything was above board.
Make sure your lawyer checks your property is compliant with regional regulations.
Before you can purchase a property in Spain, you will need an NIE number (Numero Identificacion de Extranjero). The issuing of these numbers is administered by the Extranjero section of the National Police (Policia Nacional). You must complete an application form and present it with your passport (and photocopies of the details page from your passport) at a local office of the national police.
When your number is issued (allow at least four weeks), you must return to the police office to collect it. Some offices will allow a third party to present the application and collect the number on your behalf. Others insist you must present yourself in person. (The rules seem to change on this every few months).
If you are not in Spain, you can get an NIE from your nearest Spanish consulate or embassy. You will need to provide proof of why you need the NIE.
In Spain, debts stay with the property. If you unwittingly buy a property which has outstanding bills (including community charges, electricity, gas), taxes or mortgage payments, these become your responsibility. Any good lawyer will make sure that there are no debts outstanding, or if there are that the contract will allow for the debts to be paid out of the purchase price.
Your lawyer should also check that the building conforms to planning regulations i.e. that the building had planning permission and any modifications to the original building are also legal.