Foreclosure 1031 Exchange
A forced sale can still be planned like any other
The IRS treats a foreclosure, short sale or deed in lieu on investment property as a sale, so it can produce a taxable gain even when you walk away with no cash. In some cases the transfer can be planned as a 1031 exchange, but only if the exchange is in place before the transfer and the debt you are relieved of is replaced. A tax advisor should look at your numbers first.
The distressed property review: 5 items. The first is free on this page.
Updated November 13, 2026 by Private Exchange Group. 3 minute read. Not tax or legal advice.
The short version
- The IRS treats a foreclosure as a sale, even when you hand the property back to the lender voluntarily.
- Debt you are relieved of counts as money received, so it must be replaced with new debt or cash to avoid boot.
- Canceled debt above the property's value on a recourse loan is ordinary income, separate from the gain on the transfer.
- An exchange has to be set up before the transfer date, which a lender or a court may control instead of you.
When the property is losing and the lender is calling
An owner whose investment property is behind on payments usually has one goal: stop the damage. A tenant left, a balloon payment came due, the rents no longer cover the loan. The options on the table are a foreclosure, a short sale the lender approves, or a deed in lieu. Giving the property back does not end the tax question.
IRS Publication 544 says a foreclosure or repossession is treated as a sale or exchange from which you may realize a gain or loss, even if you voluntarily return the property to the lender. An owner who bought long ago, took depreciation for years or refinanced can have a low tax basis and a loan balance well above it. That gap can be a taxable gain with no cash to pay it.
How the IRS measures a foreclosure
The answer depends on the loan. If the debt is nonrecourse, meaning you are not personally liable, the entire unpaid balance is the amount realized, and the gain is that amount minus your adjusted basis. According to IRS Publication 4681, a foreclosure on nonrecourse debt above the property's value does not produce ordinary income from canceled debt.
If the debt is recourse, the amount realized is generally the smaller of the debt or the property's fair market value. Debt canceled above that value is ordinary income, reported separately from the gain or loss on the transfer. Publication 4681 describes exclusions, including bankruptcy, insolvency and qualified real property business debt, that may apply. Whether any of them fits is a question for your tax advisor.
Swipe the table sideways to see every column
How IRS Publications 544 and 4681 describe a foreclosure. Your tax advisor applies them to your loan.
Before closing or not at all
Three ways a sale stops being an exchange
Touch money. Pay tax.
If the proceeds are paid to you or to someone acting for you, the sale is taxable. The intermediary has to be in place before the closing.
Day 45 passes
You have 45 calendar days from the closing to name, in writing, the property you may buy. Weekends and holidays count.
You come out with cash
Cash you keep, or a loan you pay off and do not replace, is taxed up to the amount of your gain.
General rules, not tax or legal advice.
Where an exchange can help and where it cannot
A 1031 exchange is aimed at the gain on the transfer. Under Treasury Regulation 1.1031(d)-2, debt you are relieved of is treated as money received, which makes it boot. To defer the gain fully, the replacement generally needs debt at least equal to what was relieved, or cash you add to cover the difference. An owner in distress may not be able to get a new loan, and that alone can decide it.
Canceled-debt income is a separate item from the gain or loss on the transfer, and your tax advisor should tell you how it is treated in your case. Section 1031 also says no gain or loss is recognized in a qualifying exchange, so an owner facing a loss may be better off selling at a loss without one. Run both sets of numbers with your tax advisor before you decide.
Timing decides everything in a distressed sale
The exchange must be in place before the property transfers, whether that is the short sale closing, the recording of a deed in lieu, or the foreclosure sale. A short sale gives you a closing date you can plan around. A foreclosure date is set by the lender or the court process, and the 45 day and 180 day periods run from the transfer, not from the day you decide to exchange.
In a short sale the lender takes the proceeds because they fall short of the debt, so little or no cash reaches the intermediary. The replacement then has to be bought with new financing and outside cash. Talk with your tax advisor and attorney about the lender's approval terms, any remaining balance you would owe, and whether the numbers justify an exchange before you commit.
Get advice before the transfer date is set
The earlier the call, the more options remain. If a foreclosure is scheduled, a short sale is being negotiated or a deed in lieu is on the table, PEG will tell you directly whether an exchange is worth exploring, what has to be in place, and which questions belong with your tax advisor. PEG does not give tax or legal advice and makes no promise that an exchange fits. Contact PEG to start that conversation.
Questions people ask
Can you do a 1031 exchange on a foreclosure?
Sometimes. Because the IRS treats a foreclosure as a sale or exchange, the transfer can be planned like other sales, with an exchange agreement in place first and replacement property bought within the 45 and 180 day periods. In practice, control of the date, new financing and replacing the debt decide whether it works. Ask your tax advisor before you count on it.
Do I owe tax if the bank takes my rental property back?
You may, even with no cash in hand. The IRS treats a foreclosure or deed in lieu as a sale, and gain is measured against your adjusted basis, which depreciation lowers. A recourse loan can also produce canceled-debt income. Your lender should send Form 1099-A or 1099-C, and your tax advisor can work out what applies to you.
Is a short sale better than a foreclosure for a tax free exchange?
A short sale is usually easier to plan around, because it has a negotiated closing date and a settlement statement, which leaves time to put an exchange agreement in place first. The tax measurement of each depends on your loan and your basis, so neither is automatically better. Compare both with your tax advisor and attorney before you choose.
Does a 1031 exchange cover canceled debt from a foreclosure?
Treat them as separate questions. The IRS describes canceled-debt income on a recourse loan as separate from the gain or loss on the foreclosure itself, and Publication 4681 lists exclusions such as insolvency and bankruptcy that may apply to it. An exchange is aimed at the gain on the transfer. Your tax advisor should handle the canceled-debt side.


Know where you stand before you close
Tell us when the sale closes and what you own. You will hear where you stand and what has to happen first.
- Whether the property qualifies
- Your 2 deadlines on a calendar
- What your closing agent needs
Asking commits you to nothing. It keeps the option open.
Keep reading
Sources
- IRS Publication 544, Sales and Other Dispositions of Assets
- IRS Publication 4681, Canceled Debts, Foreclosures, Repossessions, and Abandonments
- 26 CFR 1.1031(d)-2, Treatment of assumption of liabilities
- 26 U.S.C. 1031, Exchange of real property held for productive use or investment
- 26 CFR 1.1031(k)-1, Treatment of deferred exchanges
