A possible solution to avoid a hefty inheritance tax bill would be to place the property in the ownership of a UK limited company which would see the shares in the company pass as per inheritance rules or any valid will without being affected by Spanish inheritance tax.
Negative aspects to this option would include the hefty set-up costs as well as annual costs involved in carrying-out the mandatory statutory annual reporting related to running a company.
Also, there might be issues if trying to sell the property in the future while still under company ownership.
On the positive side, if you are facing a situation where you are unable to take advantage of any of the other tax reducing methods already mentioned, this option can be carried-out almost at any time up until the inheritance becomes operative and avoid paying up to 40% of the value of your assets in Spain.
Also, it is possible to mitigate the problem regarding future resale of the property by returning the property to private ownership and then selling-on.