The Central Economic-Administrative Court (TEAC), dependent on the Ministry of Finance, has resolved certain relevant doubts regarding deduction for investment in habitual residence. It has done so through a resolution issued on October 20, 2025, in which it supports the inclusion in the deduction base of the Personal Income Tax (IRPF) of the amounts obtained from the sale of the habitual residence when they are used to pay off the mortgage that encumbered it, if it was purchased before 2013.
The case starts with a taxpayer who, in 2018, sold what was his habitual residence and used part of the amount received to pay off the mortgage loan with which he had financed it. This amount was included in his Income Tax return as the basis of the deduction for investment in habitual residence. However, the Tax Management Office considered that this cancellation could not be counted for deduction purposes, as it occurred after the sale of the property.
You may be interested
Strike at the Treasury: technicians demand mobility, recognition and greater effectiveness against fraud
A retiree who worked for 43 years at the Post Office and who receives a pension of 640 euros must return 44,424 euros to the State: “Working all my life and paying taxes for this”
The controversy centers on the interpretation of Transitional Provision 18 of Personal Income Tax Law 35/2006, which allows those who bought their home before 2013 to continue applying the deduction for investment in their primary residence. This deduction was eliminated for homes purchased after that year. In this case, the taxpayer had been applying said deduction because he bought his house before that date.
The money from the sale of the habitual residence can be deducted in personal income tax, if it is used to pay off the mortgage
After a difference in criteria in the Tax Management Office and the Regional Economic-Administrative Court (TEAR), the TEAC endorses that the amounts from the sale of the primary residence can be included in the personal income tax deduction base, provided that they are used to pay off the mortgage loan linked to its acquisition.
In its resolution, the Court recalls that the fungible nature of money prevents establishing distinctions based on the origin of the funds used. The determining factor is that the cancellation is carried out with the objective of extinguishing the outstanding debt for the purchase of the home, and that the general requirements of the deduction are met, such as that the property has constituted the habitual residence until its sale and that the taxpayer has sufficient income that year.
The TEAC has also established that it is not legally relevant that the cancellation amount comes directly from the sale price, since what is deducted is not the fact of selling, but rather of having invested in the acquisition of the primary home.
Therefore, when the cancellation of the loan occurs at the time of the sale and for that purpose, it can be included in the deduction base.


