Sale and reinvestment in main residence with mortgage. Personal income tax exemption. Capital gains. Supreme Court jurisprudence. Expert legal advice.

Sale and reinvestment in main residence.

In Spain, the vendor of a property has to pay mainly two taxes: the Municipal Plusvalía and the Capital Gains Tax (CGT). In this week’s article we analyse the tax benefit most frequently used by taxpayers when it comes to paying CGT. The exemption for sale and reinvestment in main residence. Specifically, whether it is possible to make use of this exemption when reinvesting by means of a mortgage.

Capital gains tax: How does it work? Is it always payable?.

The capital gain is the difference between the transfer value and the acquisition value. If Peter buys his house for 200.000€ and sells it later for 275.000€, his gain of 75.000€ will be taxable. Taxation is different for residents and non-residents. Non-residents are taxed at a rate of 19%. Tax residents in Spain are taxed at a rate ranging from 19% to 28%.

However, this tax is not always paid. For instance, people over 65 years of age (or people in a situation of severe dependence or great dependence) who transfer their main residence, are exempt from this tax. The same applies in cases of sale and reinvestment in a main residence.

Exemption for reinvestment in the main residence.

This tax benefit is regulated in article 38.1 of the Personal Income Tax Act: “Capital gains obtained from the transfer of the taxpayer’s main residence may be excluded from taxation, provided that the total amount obtained from the transfer is reinvested in the purchase of a new main residence under the conditions determined by regulations.”.

What is considered to be a principal residence and what are the deadlines?

For the property transferred to be considered a main residence, the taxpayer must have lived there permanently for at least three years prior to the sale. On the other hand, the purchased property will be considered as “main residence” only if it is occupied permanently at the latest one year after the purchase.

The reinvestment must also be made within the deadlines set out in the law: either within two years after the sale or within two years before the sale. Either in a single operation or in instalments.

Sale and reinvestment in a primary residence with a mortgage: is it possible?.

Let’s examine it with an example. Maria sells her main residence for 300.000€ and in the following 2 years, she buys another house, which she turns into her main residence for the same price. However, from the purchase price of her new home (300.000€) she only pays 50.000€ since the rest 250.000€ is financed by means of a mortgage.

Until recently, the Tax Agency understood the concept of “reinvestment” as a practically “physical” material transfer of money from one place to another. And within this interpretation, the sale and reinvestment in a main residence by means of a mortgage was excluded. That is to say, for tax purposes, Maria would only have reinvested 50.000€ according to the Spanish Tax Office.

However, the Spanish Supreme Court confirmed in ruling 1239/2020 that this interpretation was erroneous and excessively restrictive. Since it introduced limits and conditions that were not included or foreseen by law. For this reason, any reinvestment that is carried out within the period stipulated by law, even if it is by means of a mortgage, can be applied to avoid paying capital gains. And continuing with the previous example, Maria could count as reinvestment, the totality of the purchase price (300.000€).


Being well advised when buying or selling a property is essential. At White-Baos Abogados we are experts in real estate and tax law. If you are selling and/or buying a property, do not hesitate to contact us. We will study your case and offer you expert legal advice.

The information provided in this article is not intended to be legal advice, but merely conveys information relating to legal issues.

Carlos Baos (Lawyer)

White & Baos.

Tel: +34 966 426 185


White & Baos 2023 – All Rights Reserved.

You may be interested in the following services and articles:

Is it possible to sell a protected public house?. We explain everything you need to know. Right of first refusal. Maximum price. Valencian Region. Buying and selling a property.

Reference value and its new regulation. Legal Regulations. Its importance in Spain with the transaction with real estate assets: purchase, selling, etc.

Documents that we should reviewed with your lawyer before signing them, when selling or buying a real estate property in Spain. Contract with the agent, reservation, arras, etc..

Leave a Reply

Your email address will not be published. Required fields are marked *