Cash-out refi then 1031 exchange — do I still pay capital gains?

Trying to figure out if I messed up my timing. I did a cash-out refinance on my rental property in March, pulled out about six figures in equity. Then in September I sold that same property and completed a 1031 exchange into a bigger duplex. The 1031 went through a qualified intermediary, the timelines were fine, and I hit the 180-day close. My question is about the refi cash I already pocketed. My CPA last year said a cash-out refi before a 1031 is fine because a loan isn't boot. But now a friend is telling me the IRS can recharacterize it as taxable boot if the refi happens too close to the sale. Do I still pay capital gains on that refi money, or does the 1031 fully shelter everything?

31 comments

The refi-then-1031 strategy is a known move but it has real risk depending on timing and intent. A cash-out refinance is not boot by itself — you're borrowing against equity, not receiving sale proceeds. That part your CPA got right. The concern is a doctrine called "step transaction" where the IRS collapses two separate steps into one if they're economically interdependent. If a court or examiner concludes the refi and the sale were really one transaction designed to extract equity tax-free, the cash could be treated as boot and become taxable gain. March to September is six months, which is not horrible, but the IRS looks at whether the loan was paid off at closing and what the proceeds were used for.

Derek N.

Author

The loan was paid off at the closing of the sale, yes. The refi proceeds I used partly to do repairs on another property and partly just sitting in savings. Does using it for another property help or hurt the argument?

Using it for property improvements on a separate asset probably helps show business purpose rather than a disguised distribution. Keep documentation — receipts, bank statements showing the funds moving to that renovation. If you're ever questioned, that paper trail matters a lot.

Six months between refi and sale is a gray area. The cases that went badly for taxpayers tended to involve refi proceeds still sitting untouched in an account at closing, or the lender and the buyer were coordinated. If you can show the loan had an independent life — you made payments on it, you used the money for something before the sale closed — you have a stronger position.

Derek N.

Author

I did make two mortgage payments on the new loan before the property sold. That's something at least.

Worth noting: even if the step transaction argument doesn't apply, you need to watch mortgage boot on the exchange side. If the debt on the property you gave up was higher than the debt on the replacement property, that difference can be taxable boot. That's separate from the refi question entirely.

Derek N.

Author

Hadn't thought about that angle. The replacement duplex has a larger mortgage than what was left on the old property at closing, so I think I'm okay there but I need to double-check the numbers.

Yes, as long as replacement debt is equal to or greater than relinquished debt, the mortgage side is clean. Form 8824 is where all of that gets calculated — Part III walks through it: boot including net liabilities on line 15, realized gain on line 19, recognized gain on line 23, and the new basis on line 25.

I ran into almost this same question last year — cash-out about four months before closing. I uploaded my closing disclosures, the HUD-1, my Form 8824 draft, and the refinance docs to taxr.ai and had it compare what the numbers looked like under both scenarios: refi treated as independent vs. refi treated as boot. It flagged that my realized gain calculation on line 19 of 8824 wasn't matching my adjusted basis worksheet, which my preparer then fixed. Ended up with no recognized gain. The step transaction risk was noted as something only a tax professional could assess on the facts, not something a tool resolves for you.

Derek N.

Author

That's really useful. The 8824 is exactly where I'm confused — I keep getting different numbers depending on how I count the liabilities assumed.

The 1031 exchange itself doesn't care that you did a refi beforehand. Section 1031 looks at what you gave up and what you received. If you received more cash or other property than is sheltered, that's boot. The refi cash isn't "received" in the exchange — it was received months earlier from a lender. That's the core argument that separates it.

This is the right framing. The refi is a liability event, not a sale event. The IRS would have to invoke the step transaction doctrine specifically to collapse them, and they'd need to show the steps lacked independent significance.

Don't overlook depreciation recapture either. Even if the 1031 shelters all your capital gain, recaptured depreciation carries forward into the new property's basis. It doesn't disappear — it just defers. When you eventually sell the duplex without exchanging, that recapture comes due at ordinary income rates up to 25% for Section 1250 property. Your adjusted basis in the new property should reflect the carryover.

Derek N.

Author

So the depreciation I took on the old rental for however many years just reduces my basis in the new one? It doesn't get recognized now?

Correct. In a fully deferred exchange, the basis in the replacement property is calculated on Form 8824 — you carry the old basis forward, adjusted for boot and any additional cash you paid. The depreciation recapture potential travels with that reduced basis.

Step transaction doctrine is real but it's also litigated. Courts have looked at whether each step had independent economic substance. A refi six months prior, with actual loan payments made, funds deployed elsewhere — that's a different fact pattern than a refi two weeks before closing with proceeds still in escrow.

When I did a similar exchange two years ago I wasn't sure my 8824 was right, so I gave Taxr my settlement statement, the old depreciation schedule, and my draft 8824 to check whether my realized gain on line 19 tied to my original purchase docs and all the depreciation I'd claimed. It listed every piece I needed and showed which numbers didn't foot. My CPA reviewed the corrected version and filed it. The step transaction question on the refi I had to work through with her directly — that one is a judgment call on the facts, not a math problem.

Derek N.

Author

This is how I need to approach it. I think I can handle the 8824 math if I have a checklist, but the step transaction exposure is definitely something to go over with my CPA before she files.

One thing people don't always flag: if any of that refi debt was paid off by the buyer at your closing, it might show up as a liability the buyer assumed, which affects the 8824 liability calculation. Check your closing disclosure carefully against what you reported as liabilities on the exchange.

Derek N.

Author

The refi loan was paid off from the sale proceeds at closing, so the buyer didn't assume it — it was just retired. Does that change the liability side of the 8824?

No, for the exchange a loan paid off at closing from your proceeds is treated the same as a liability "assumed by the buyer" — it's debt relief. It goes on line 15 of 8824, netted against the debt you took on with the replacement property, just as if the buyer had assumed it. Worth walking through that line carefully with your preparer.

Has anyone had the IRS actually challenge the refi-then-1031 on step transaction grounds in an audit? Genuinely asking because I've seen it warned about but I don't know how common it actually is.

It's more common in promoter-driven transactions or when the refi and sale are practically simultaneous. For an independent investor with a months-long gap and documented use of proceeds, it's a known risk but not a frequent audit target from what I've seen in practice.

The IRS's own guidance on 1031 exchanges is in Publication 544 and the Form 8824 instructions. Neither specifically addresses the refi-prior-to-exchange question, which is part of why it lives in case law and private letter rulings rather than a clean rule.

Before my last exchange closed I had Taxr read through my qualified intermediary agreement alongside my 1031 timeline to flag any dates that looked tight against the 45-day ID deadline and 180-day close requirement. It marked two properties on my ID list whose contract dates were borderline and laid out what documentation I'd need if either was questioned. Really helped me walk into the closing confident the procedural side was clean — the tax analysis I handled with my CPA.

Derek N.

Author

That procedural piece is something I actually hadn't worried about since my QI handled it, but it's good to know that layer can be checked independently.

To summarize where this thread has landed: the 1031 itself looks clean based on what you described. The refi cash is not automatically boot. The step transaction question is a facts-and-circumstances judgment — your six-month gap and loan payments help, but your CPA needs to assess it on your specific record. And get the Form 8824 math right regardless, especially the liability lines and the basis carryover.

Derek N.

Author

Six-month gap, loan payments, and the 8824 liability lines — that's my to-do list, and laying it out that way finally made it click for me. I'm going to get with my CPA, bring the closing disclosures and the refi docs, and go through the 8824 together. Thanks everyone.

About Publication 527 — it covers residential rental property depreciation and passive activity rules but it doesn't go deep on 1031s. For the exchange mechanics, the Form 8824 instructions and Publication 544 are the right sources. Just flagging in case anyone ends up at the wrong place looking for 1031 guidance.

If the step transaction risk keeps you up at night, a written tax opinion from a CPA or tax attorney documenting the independent business purpose of the refinance is a form of protection. It doesn't eliminate audit risk but it demonstrates reasonable cause and good faith, which matters for penalty exposure if the IRS ever did challenge it.

Derek N.

Author

I didn't know that was an option. If my CPA thinks the exposure is real enough, I'll ask about whether a written opinion makes sense. Good to have that in the toolkit.