Property in Spain is registered in the Registro de Propiedad where you can see who owns the property, the size of the property and if there are any mortgages on the property. Only the person or persons named on the title deed have the right to sell the property. You must seek legal advice as the Spanish law system is very complex. A lawyer will usually charge around 1% plus tax which is money well spent to give you peace of mind. Ask them to confirm the fee in advance before proceeding.
We strongly recommend that you use the services of a local English-speaking lawyer experienced in property law and with good knowledge of the area you are buying in and at the same time you will need to open a local bank account. In the case of resale, the lawyer will check that the property belongs to the seller, is free of debts and has the necessary building permissions. For new construction, the same checks will be made on the land, along with a background and financial check on the builder. When your lawyer is satisfied on the above matters, your signed contract and deposit will be released to the seller. At this point, a "full" deposit of 10% or more of the purchase price will normally be payable.
Your lawyer can also arrange an N.I.E. (foreigners identity number) and residency application as appropriate. On completion day, both parties, or their representatives with suitable power of attorney, will appear before the Notary - a government official responsible for the execution of public documents - to ensure compliance with the prevailing law. The Notary acts for neither party, and does not replace the need for your own lawyer, but witnesses the signing of the Escritura de Compraventa (the transfer deed). At this time the balance of the purchase money will be paid to the seller, and any remaining purchase tax and fees will be paid. You will then have the keys to your property and a copy (Copia Simple) of the title deed until the formal deed comes to you from the land registry.
FOR WILLS - Your lawyer will advise you, but it is usually best to make a local Spanish Will to deal with your property and other assets there. At the same time you can be advised on ways to minimise your exposure to inheritance and capital gains taxes.