How to move appreciated commercial real estate out of s corp without triggering gain section 1239

We bought a commercial building inside our S corp about 12 years ago. It has appreciated a lot and we've taken depreciation every year. Now we want to hold it personally for estate planning reasons and eventually do a 1031 exchange on our own. The CPA mentioned section 1239 briefly but didn't go deep on it. I know distributing appreciated property from an S corp triggers gain at the corporate level as if it were sold at FMV, and that gain flows through to shareholders. What I can't figure out is whether there's a structure that gets the building out without that immediate recognition, or whether we're just stuck. We're the 100% shareholders. Has anyone actually navigated this?

38 comments

Went through almost this same structure two years ago. The short answer is there's no clean way to distribute appreciated property out of an S corp without triggering gain. Under the rules, an S corp that distributes appreciated property to shareholders must recognize gain as if the property were sold at FMV on the date of distribution. That gain flows to your K-1 and you pay tax on it. Section 1239 piles on top by recharacterizing what would be capital gain into ordinary income when a related-party sale or exchange involves depreciable property. So you get hit twice — gain recognition AND ordinary income treatment.

Greg K.

Author

That's what I was afraid of. So even if we try to structure it as a sale from the S corp to ourselves, section 1239 converts the gain to ordinary income because we're related parties and the property is depreciable?

Exactly. Related parties under section 1239 include a person and a corporation they control. With 100% ownership you're squarely in that definition. The gain on depreciable property in that sale gets recharacterized as ordinary income, not capital gain.

I uploaded our S corp operating documents and the building's depreciation schedule to taxr.ai and asked it to lay out where section 1239 would bite versus where regular distribution gain rules apply. It mapped out each piece — the unrecaptured 1250 gain, the 1239 recharacterization layer, and what would flow to the K-1 — which made it much easier to bring a specific question to our CPA rather than a vague one. The structure problem you're describing is real. One path some people take is contributing the property to a partnership first, but that has its own complications.

Greg K.

Author

The breakdown into those layers is exactly what I need to understand before the next CPA meeting. Did the partnership contribution route seem viable in your situation?

For us it didn't work cleanly because the S corp contribution to a partnership can still trigger gain under section 311 and 336 analogues depending on how it's structured. Worth a detailed look with a CPA who knows both S corp and partnership tax.

One thing worth separating out: the gain recognition on a distribution is one issue, the section 1239 recharacterization is a second issue. If the S corp sells to you at FMV, all gain on depreciable property is recharacterized as ordinary income under 1239. If the S corp distributes the property instead of selling, 1239 doesn't directly apply to the distribution itself — but the corporation still recognizes gain under section 311(b) as if it sold at FMV, and then you have depreciation recapture running through that gain anyway. Either way you're recognizing ordinary income, the path just differs slightly.

This is a useful distinction. So the distribution route avoids the 1239 label but arrives at a similar ordinary income result through 1250 recapture?

Mostly yes. The recaptured depreciation on commercial real estate flows out as unrecaptured section 1250 gain (taxed at a max 25% rate for individuals) and potentially some section 1245 on personal property inside the building. The exact split matters for your effective rate.

Has anyone looked at a F reorganization followed by converting the S corp to a partnership? I know that's a complex path but some advisors use it for exactly this reason — to get real estate into a partnership structure where you can eventually use section 721 for future contributions or simplify a 1031.

Greg K.

Author

I've seen that mentioned. Our CPA said the F reorg doesn't by itself get the property out tax-free, it just changes the entity type. The gain problem follows the asset.

Right, the F reorg alone doesn't solve it. The idea is converting to an LLC taxed as a partnership so future moves have partnership-level tools available. Still doesn't eliminate the original gain on extraction.

My own situation was an S corp with a warehouse that had a lot of built-in gain from appreciation. I had Taxr read through the Form 7203 (S corp stock basis worksheet), the K-1, and the depreciation schedule together and flag where the numbers connected. It drafted a question list organized by issue — recapture, basis, distribution mechanics — that I handed to the tax attorney before our planning session. That prep work probably saved an hour of billable time just getting everyone on the same page. On the substance: if your goal is a future 1031, holding the property in the S corp and doing the exchange there is one option, though it doesn't solve the personal estate planning piece.

Greg K.

Author

Doing the 1031 inside the S corp keeps the gain deferred but doesn't get the asset into our names, which is the estate planning goal. I hadn't thought about using that question list approach before an attorney meeting though — that's genuinely useful.

Section 1239 specifically covers sales or exchanges between related parties where the property is depreciable in the buyer's hands. If you sell the building to yourself personally, it will be depreciable in your hands (you'd depreciate it as a rental or investment property). That triggers 1239. The only scenario where 1239 wouldn't apply is if the buyer couldn't depreciate the property — which doesn't apply here.

So there's no way to structure the sale to yourself to escape 1239 — the depreciability in the buyer's hands is the test, not whether the seller already depreciated it?

Correct. It's about whether the transferred property will be depreciable to the transferee. Since commercial real estate is depreciable, any related-party sale triggers 1239 recharacterization of the gain.

Practical reality: most people in this situation either pay the tax and move on, or they hold the property inside the S corp until death for a step-up in basis at the shareholder level, or they look at an installment sale structure to spread the tax over time. The installment sale doesn't eliminate 1239 recharacterization, and for a related-party sale of depreciable property section 453(g) generally treats all payments as received in the year of sale, so it won't spread the income unless you can show tax avoidance wasn't a principal purpose. Worth running the numbers on each path.

Greg K.

Author

The installment sale option is worth exploring. I assume that on a related-party sale like this, all the gain is still accelerated into year one, not just the recapture piece?

Yes — on a related-party sale of depreciable property, section 453(g) generally treats all payments as received in the year of sale, so the whole gain is recognized up front, not just the recapture. Nothing gets spread across the installment period unless you can show tax avoidance wasn't a principal purpose.

The step-up at death angle is real but you'd need to hold through the shareholder's death for the S corp stock to get a step-up. The stock gets a step-up, not the underlying asset — so the built-in gain inside the corp remains unless the heirs liquidate shortly after and can use the stepped-up basis of the stock to absorb some of the gain. It's complicated and state law matters too.

Greg K.

Author

That's a helpful clarification. The stock step-up doesn't flow through to the asset-level gain. So a liquidating distribution after death still triggers the asset-level gain — it just gets offset by the increased outside basis from the step-up.

Exactly right. The mechanics work in your favor in that scenario but it requires careful timing and it's not a full elimination of gain, just a mitigation depending on how much the stock appreciated relative to the asset built-in gain.

Has anyone actually used a charitable remainder trust to handle the extraction? The idea being the S corp contributes the property to a CRT which sells it without immediate gain recognition, then pays out an annuity stream. I've seen this suggested but never seen someone actually do it with S corp property.

The CRT path with S corp property has some real complications — S corps can't have most trusts as shareholders, and the contribution mechanics are tricky. It's a planning concept that works better when the property is already held personally.

That makes sense. The shareholder restriction alone probably kills it at the S corp level before you even get to the CRT rules.

Dealt with this last year — different property type but same section 1239 question. I loaded the S corp's past three years of returns and the depreciation schedule into Taxr and asked it to pull out every line that would be affected by a distribution versus a sale scenario. It showed me the Form 4797 entries, the K-1 line 17 items, and where ordinary income would appear versus capital gain on each path. Having that side-by-side made the conversation with the enrolled agent much more concrete. We ended up paying the tax on a sale and moving on — sometimes that's the cleanest answer.

Greg K.

Author

Thanks — the Form 4797 and K-1 line 17 comparison is exactly what I need to build. That confirms I should get an enrolled agent or CPA who handles S corp dispositions specifically to map this out before deciding.

Worth flagging that if the S corp has been an S corp the entire time you've owned the building, there's no built-in gains tax (the BIG tax under section 1374) to worry about from a prior C corp conversion. But if it converted from a C corp within the recognition period, that's a separate layer of entity-level tax on top of everything else. Important to know which situation you're in.

Greg K.

Author

Always been an S corp, so the BIG tax isn't an issue. Good flag though — I didn't even think to mention that detail.

The 1031 exchange inside the S corp is worth revisiting as a middle path. If the S corp exchanges into a different commercial property, gain is deferred. Then if the estate planning goal is getting property into your personal names eventually, you're still stuck — but you've deferred the gain and potentially exchanged into a property with better characteristics for a future plan. Doesn't solve everything but it buys time.

Greg K.

Author

Agreed it buys time. The challenge is that the whole point is personal ownership for estate planning, and doing another exchange inside the S corp just kicks that can down the road. But if tax rates or circumstances change it could be a reasonable bridge.

Nobody has mentioned the holding period on the distributed property. When an S corp distributes property in kind, the shareholder's basis in the received property is its FMV at the time of distribution, and the holding period starts fresh on the date of distribution. So if you plan to sell personally later, you'd need to hold more than a year to get long-term capital gain treatment on any post-distribution appreciation.

The core issue is that section 1239 is essentially a one-way ratchet — it converts capital gain to ordinary income, it doesn't work in reverse, and there's no exception carved out for related parties who have legitimate non-tax reasons for the transfer. Congress was explicit about that. The only real levers are timing, installment treatment only if you can show under 453(g) that tax avoidance wasn't a principal purpose, or accepting the tax cost and factoring it into the decision.

Greg K.

Author

That framing helps. It's not a problem to solve around, it's a cost to quantify and decide whether the estate planning benefit justifies it. Time to get a CPA or enrolled agent who handles S corp real estate dispositions to run the actual numbers on each path.

Depreciation recapture on commercial real estate is unrecaptured section 1250 gain — not section 1245 — which means it's taxed at a maximum 25% rate at the individual level rather than ordinary income rates, with one exception: if there was any accelerated depreciation taken above straight-line, that portion is 1245-type ordinary income. Most commercial property taken straight-line under MACRS won't have that issue, but it's worth confirming with your depreciation schedule.

This is a useful nuance. Under MACRS everything is straight-line for real property so the 1245 accelerated piece shouldn't appear — but if there's personal property or section 179 in the mix it could.

Right — cost segregation studies in particular can reclassify components into shorter-life personal property categories that depreciate faster, and those pieces would be 1245 property with full ordinary income recapture, not the 25% unrecaptured 1250 rate.