Resident. If you die intestate (without a will), then Spanish inheritance law applies. If you have a will with a codice specifying that you want UK (or insert your country of nationality here) law to apply, then UK inheritance law applies. In either case, the heirs pay inheritance tax based on the laws of the Region of Spain where the deceased was resident for the majority of the previous five years. That ranges from the almost 0% tax of Madrid to the hefty taxes of Andalucía.
Non-Resident. Since the first of January of 2015, exactly the same thing applies to non-residents with Spanish assets if the resident is an EU national. If you aren’t an EU national, then instead of the regional inheritance tax law being applied, you get the default inheritance tax law applied, which is rather a lot.
Spain has a national inheritance and gift tax. But the regions have been granted permission to collect and keep this tax, at the same time being allowed to vary the imposition levels. So some regions have all but abolished inheritance tax (ie Madrid) whereas other regions keep it high (ie Andalucía – they’ve just changed it, but not that much).
Now, in the old days, if a non-resident died, the national tax law applied. The EU ruled that this was contrary to EU law, and so on Jan 1, 2015, the Ley estatal de Sucesiones y Donaciones was changed (via the Disposición Final Tercera de la Ley 26/2014, por la cual se modifica la Disposición Adicional Segunda de la Ley 29/1987, del Impuesto de Sucesiones y Donaciones, if you must know) to make residents and EU non-residents tax treatment the same.
But, this only applies to EU nationals. So if a US citizen who is non-resident dies in Spain, his heirs are taxed under the old system, ie, the high national tax level. But if the American is resident in Spain, then the regional tax is applied.
So when Britain leaves…
The heirs of residents will continue to be taxed under the regional tax system. But the heirs of non-residents return to the old system, meaning they will be taxed at the higher rate.
What about the will?
Under the EU law, EU nationals are subject to the inheritance law of their country of residence unless they specify in their will that it should be that of their nationality. (Ironically enough, although this benefits Brits in Spain, since the UK has opted out of EU decrees for family life, Spaniards in the UK don’t get the same benefit).
Now, this right to establish your home country law of inheritance is both EU law and written into the Spanish civil code irrespective of nationality. So this right will continue after Brexit – Brits who die in Spain can distribute their assets under UK law, not Spanish.
So when Brexit happens…
The heirs of Britons who are resident in Spain will continue to be taxed in the same manner they are now. But the heirs of non-resident Britons will be hit with a higher tax bill, as happened before 2015. In either case, the assets can be divided according to UK law if so desired.
The above is my own personal interpretation of the law, don’t take it as gospel and consult a professional before taking any decisions. As always, wait until Brexit happens before getting excited about any what-if’s!