“The avoidance of taxes is the only intellectual pursuit that still carries any reward.” – John Maynard Keynes

Imagine yourself in a Vegas casino with a pair of hot dice at the craps table. Nestled in front of you is $100,000 in chips, the towering stacks representing your winnings.

Did you know that in this (unlikely) scenario you have a silent partner?

Oh, yes. And he’s standing right beside you, wearing a red, white, and blue suit and sporting a top hat. That’s right, your partner is Uncle Sam – and when you go to cash in those chips, he’ll demand that you leave 15% of them (or more) with him.

The same is unfortunately true even if you are using your money much more wisely – by investing in real estate.

Every time a real estate investor sells a property, he is confronted with the harsh reality of Uncle Sam entering the picture to claim his share of the profits in taxes.

If you have held the property for at least one year, Uncle Sam’s pinch will only be 15% of your capital gains. But, depending on where you live, your state may want to take a bite out of your profits too.

And then there’s a little-known tax called “depreciation recapture,” which can add even more to your tax bill. Worse yet, if you held the property for less than one year, ouch! Your tax bite will be at an ordinary income rate that could range up to 45% (or more) when you include state income taxes.

Is there a way to keep Uncle Sam’s hands out of your pockets? Yes … and people like Donald Trump have known about it and have been using it for decades. I’m talking about a 1031 Exchange.

The best description of a 1031 that I have found is this:

“A 1031 Exchange is an interest-free loan from the IRS that, under the proper circumstances, may be altogether forgiven.”

Sound too good to be true? Perhaps. But it is true. Let’s take a closer look at that definition.

1. A 1031 Exchange is an interest-free loan from the IRS. You defer paying taxes. So, in essence, Uncle Sam is letting you borrow his money in the form of taxes that you would otherwise have paid to him. That’s the loan part.

2. Uncle Sam doesn’t charge you interest on the unpaid taxes. That’s the interest-free part.

3. Under the proper circumstances, in fact, the taxes may be altogether forgiven! That is, you never have to pay the taxes during your lifetime. And when you die, your heirs inherit your property at the existing fair market value. So they don’t pay your deferred taxes either. That’s the forgiven part.

How do you put a 1031 Exchange to work for you? Here’s just one of hundreds of true stories I could tell you …

I had just completed a 1031 Exchange seminar when a realtor came up to me, wearing a sheepish grin.

“Gosh,” he said. “I didn’t know that depreciation of investment property could also be 1031 Exchanged. I have a client who listed two of his commercial properties with me. He had held those properties for years, but when he sold them he didn’t have any profit – so I never mentioned 1031 Exchanging. I guess I should have.”

Yes, he should have.

Simply put, Uncle Sam allows a real estate investor to “fictionally” depreciate his investment and use that depreciation (27.5 years for residential, 39 years for non-residential) to offset income produced by the investment property.

Depreciation is a major reason people buy investment real estate. However, when you sell your investment property, you must “recapture” all of the prior depreciation and either 1031 Exchange it or add it to your tax return for the year the property was sold. The tax rate of recapture of depreciation for real estate is 25%.

The realtor went on to tell me about another client, a dentist. The dentist had done quite well over the years. He owned five debt-free single-family rentals and a debt-free (and very nice) residence. But the realtor was unable to interest him in purchasing additional investment properties.

I persuaded the realtor to let me talk to the client, so he set up an appointment.

We arrived at the dentist’s lovely home and, after a little polite conversation, dove into the purpose of the meeting. I complimented the dentist on his accomplishments.

“Doctor.” I said. “It isn’t often that I run into people who have done as well as you. You have accumulated a lot of real estate wealth. I congratulate you.”

While the dentist basked in glory, I asked four or five questions germane to each of his investment properties. I quickly calculated how well he was doing with each one. All were doing okay, with a Return On Equity ranging from 4% to 11%. When combined, the dentist had nearly $650,000 of equity in his rentals and another $400,000 of equity in his residence.

I asked him what his goals were, and he told me that he wanted to retire in two years, at age 55, and turn his thriving practice over to his son (who would be graduating from dental school in a few months).

His plan seemed to be working perfectly – but something gnawed at me. Was his plan really that perfect?

“What do you intend to do with your rental properties in the long run?” I inquired.

The dentist said that he would use the rents to supplement his retirement income – and that someday he would deed them over to his son.

I thought about that for a moment. Something was missing – something very important.

I looked at the dentist and said, “Doctor, your plan is admirable.” I purposely hesitated a beat. “But there’s just one thing that baffles me.”

“What is that?” The dentist asked, curiosity written on his face.

“Doctor, why are you going to allow your son to make the same mistake you made?”

The dentist was confused. How could he have possibly made a mistake when, sitting on the table before us, was a real estate portfolio that showed proof of the respectable wealth he had accumulated?

Undaunted, I continued.

“You have paid rent on your dental office for 20-plus years – and now you’re going to usher in your son and let him pay rent on it for another 20-plus years.”

By the dentist’s reaction, I could tell I had ruffled his feathers. I doubt if anyone had ever spoken to him so bluntly. As he silently smoldered, the realtor was trying to figure out how to crawl under the table and hide.

“You know, you’re right.” The dentist finally admitted. “I was offered a chance to buy the office building twice, but I was just too busy to go over the numbers. Each time, the building was sold to someone else”

I took a deep breath. “Doctor, if I may, let me cut to the chase. You’ve done extremely well. Let’s make sure your son does even better. We can sell your five rental units and buy the building you’re in … or another medical building of your choosing … or we can build or remodel a medical building to suit your needs.”

I had his full attention. He was all ears.

“Your building would have additional office space that you could rent to other dentists and doctors. Their rents would be extra income for you in retirement.”

“Exactly how would that work?” he asked.

“Using a 1031 Exchange, you would sell your rental units and use the $650,000 in equity to buy your office building. That’s plenty for a down payment – enough to ensure a positive cash flow. The monthly rent payments should equal any lost income sustained by the selling of your five rental units, and your son’s monthly rent payment will service the new mortgage.”

A big smile unfurled on his lips.

“And here’s the frosting on the cake: When you die, your son inherits the building on a stepped-up basis – at fair market value. Because you used a 1031 Exchange when you bought the building, your son will not have to pay any taxes on it. And the whole process won’t require you to take one nickel out of your pocket.”

“That’s a great idea!” said the dentist enthusiastically. “Can we list all five rental properties tonight?”

[Ed. Note: Thomas Phelan is a financial author, an active real estate investor, and a contributing editor to Main  Street Millionaire, ETR’s real estate investment education program. He is also the author of a new program to help you take advantage of 1031   Exchanges.]