Most owners never think about foreclosure tax consequences until it is too late, because tax planning content assumes the property only goes up. You buy, you hold, you sell into a 1031, you defer your gain, and one day your heirs collect a stepped-up basis that wipes the slate clean. That is the dream scenario, and it works.
But real estate does not always cooperate. Properties go underwater. Lenders foreclose. Loans get forgiven. And the tax code has a brutal surprise waiting for owners who think a bad deal at least comes with a tax write-off. Sometimes you lose the building and owe tax on top of it.
Here is how the distressed side of the ledger actually works, and where the deferral strategies still have room to operate.
Foreclosure Tax Consequences Start With One Fact: It’s a Sale
Start with the hardest concept to accept. When a property is foreclosed, transferred by deed in lieu, or sold short, the IRS treats it as a disposition. It is a sale, even though you walked away with nothing and possibly with a loss in your bank account.
That matters because a sale is a taxable event measured against your adjusted basis, not against what you originally paid. If you ran cost segregation studies and took bonus depreciation over the years, your basis is low. A low basis means the difference between what the debt clears and what you have left in the property can show up as a large taxable gain. You can lose a building and still trigger a six-figure gain on paper.
Two Separate Tax Hits
A distressed exit can produce two different kinds of taxable income, and they are calculated separately.
The first is gain or loss on the disposition. This is the amount realized minus your adjusted basis, and it carries depreciation recapture along with it. Recapture does not disappear just because the deal failed.
The second is cancellation of debt income, often called COD, under Section 61(a)(11). If your lender forgives part of what you owe, the forgiven amount can be ordinary income. This is the phantom income problem. You receive no cash, but the IRS sees the relief from debt as income to you.
Whether you face one hit or both comes down to a single distinction in your loan documents.
Recourse vs. Nonrecourse Decides Everything
This is the fork in the road. Before you model anything, you need to know which kind of debt you are dealing with, because it changes the entire calculation.
With nonrecourse debt, the lender can take the property but cannot pursue you personally for any shortfall. For tax purposes, the full outstanding debt is treated as your amount realized. There is no separate COD income. Everything rolls into a single gain or loss calculation.
With recourse debt, the lender can come after you for the deficiency. The tax treatment splits into two pieces. Your amount realized is capped at the property’s fair market value, which sets your gain or loss to that point. Then any forgiven debt above that fair market value becomes COD ordinary income. Two buckets instead of one.
The same foreclosure can produce very different results depending on which box your loan falls into. Read the loan docs and check your state law before you assume anything.
Section 108: How COD Income Gets Sheltered
Here is the relief valve. COD income is not automatically taxable. Section 108 provides several ways to exclude it, and these were the lifeline for countless owners during the last major downturn.
Insolvency is the workhorse. You can exclude COD income to the extent your liabilities exceeded your assets immediately before the discharge. If you were underwater across your whole financial picture, this exclusion often covers most or all of the COD hit.
Bankruptcy under Title 11 fully excludes COD income for debt discharged in the case.
Qualified Real Property Business Indebtedness, under Section 108(c), is an elective exclusion available to non-corporate taxpayers on business real estate. It excludes the COD income but reduces your basis in the property. That makes it a deferral rather than true forgiveness, since the lower basis comes back to find you later.
None of these are entirely free. The insolvency and bankruptcy exclusions require attribute reduction under Section 108(b). You pay for the exclusion by burning through tax attributes like net operating losses, credits, and basis. The income gets excluded, but you give up future shelter to get there.
You claim these exclusions and record the attribute reductions on Form 982.
Where 1031, DSTs, and Step-Up Fit In
The deferral strategies that work so well on the way up have limited reach once a property is in distress.
You generally cannot 1031 out of a foreclosure. A forced disposition by a lender is not a structured exchange. There is no qualified intermediary holding proceeds and no replacement property identified inside the deadline. The distress itself is the taxable event, and by the time the lender acts, the exchange option is gone.
Step-up in basis does not help a living owner either. Section 1014 only triggers at death. A foreclosure during your lifetime is fully exposed to gain, recapture, and COD.
This is why the planning window is before default, not after. If a property is underwater but not yet foreclosed, that is the moment when a 1031 exchange or a strategic sale into a Delaware Statutory Trust can still redirect the exit. A DST lets a tired or distressed owner move into passive, institutional-grade replacement property and keep the deferral intact. Once the lender forecloses, you are no longer in deferral mode. You are in Section 108 cleanup mode.
The Distressed CRE Playbook
The Missing Layer in Commercial Real Estate Deal Analysis: Tax Intelligence
When a property heads toward trouble, the sequence looks like this.
- Determine whether the debt is recourse or nonrecourse. This drives every number that follows.
- Model the gain on disposition, including depreciation recapture, against your adjusted basis.
- If the debt is recourse, identify the COD income above fair market value.
- Run your Section 108 exclusion eligibility, with the insolvency calculation as the centerpiece.
- File Form 982 to claim the exclusions and record the required attribute and basis reductions.
The Takeaway
The same low basis that makes cost segregation and bonus depreciation so powerful on the way up is exactly what creates the tax trap on the way down. A failed deal is not a clean loss. It is a disposition with its own gain, its own recapture, and potentially its own phantom income.
The good news is that the code gives distressed owners real tools, from the insolvency exclusion to a pre-default exit into a DST. The owners who come through these moments intact are the ones who run the numbers before the lender does.
These situations are fact-specific and rarely have a clean single answer. They turn on the loan documents, state law, and the owner’s full financial picture, and they call for coordination across the CPA, the attorney, and the tax-strategy side of the table. If you are an advisor or broker working a client through a distressed property, the time to bring the whole team together is before the lender moves, not after. That is the conversation worth having early.
This material is for educational purposes and is not tax or legal advice. Distressed property taxation is fact-specific and turns on your loan documents, state law, and overall financial position. Work with a qualified advisor before acting.


