Editor's note: This story originally published in December of 2017.

PALM BEACH — Donald Trump's deal with the town of Palm Beach to turn Mar-a-Lago into a private club hinged on an act of charity crafted to skirt IRS scrutiny and deliver for Trump a seven-figure tax break, a Palm Beach Post investigation has found.

To make sure Trump could get the $5.7 million deduction, America's future president and his lawyers intentionally left out those details from the written agreement with town officials.

READ: How Trump’s Mar-a-Lago private club deal took advantage of IRS rules

The deal, which took shape in public meetings over several months in 1993, provides the best look at Trump's largest form of charity: an obscure and controversial land-use deduction known as a preservation easement.

Since then, Trump has applied the tax break to his golf courses and estates to potentially deduct more than $100 million from his taxes, even though the IRS once listed such deductions among their "Dirty Dozen Tax Scams." One tax expert said that if Trump is under audit, as he says he is, his frequent and vigorous use of the deductions "absolutely" could be why.

PHOTOS: Trump's Mar-a-Lago Through the Years, Inside and Out

Congress created the charitable deduction in 1969 as an incentive to conserve land and preserve historic buildings, but by the 2000s, it became widely abused by the wealthy. In such easements, owners donate control of property, be it land or historic features, to a nonprofit, reducing an estate's value.

One way it was abused: Donors claimed the deduction when they got something in return, which means, in essence, that it wasn't a charitable donation. In Trump's case, he did get something in return: permission to turn the private residence into a money-making club.

At the time, the IRS did little to scrutinize such deals, tax experts told The Post, and even if they had, it would have been harder to confirm because some details of the deal were not put in writing.

With little to worry about from the IRS, Trump stood to deduct $5.7 million in income from his 1995 tax returns, an amount never-before revealed publicly.

The Post discovered the appraisal, which Trump paid for to calculate the deduction, amid documents in a lawsuit he filed against Palm Beach County. Easement appraisals normally are considered private tax documents.

Trump has not released his tax returns so the status of the deduction is unknown.

But the deal, made nearly 25 years ago, continues to pay dividends: Mar-a-Lago has been restored to its original glory and is a thriving private club, a winter White House where Trump now entertains diplomats and heads of state.

Was it charity?

In the early 1990s, the future of Mar-a-Lago, the island's most opulent estate, was in jeopardy.

Trump said he had spent millions fixing up the mansion built in the 1920s by cereal heiress Marjorie Merriweather Post. With the rest of his real estate empire crumbling and the bank demanding payment on the mortgage, it was time to make some money off it.

His first try -- breaking up the 18-acre property and building homes on it -- was rejected by the Town Council in 1992, partly because he didn't have an adequate plan to preserve the mansion.

The next year, he pursued a new idea.

In March 1993, his Palm Beach attorney, Paul Rampell, filed paperwork asking the council to allow Trump to turn Mar-a-Lago into a private club, one that would be open to anyone who could afford initiation fees, which would start at $50,000.

This time, Trump knew he had to have a preservation plan. Rampell told the Town Council that Trump would offer to "voluntarily make an income tax deductible donation," vowing to preserve the interior of Mar-a-Lago.

But the Town Council was highly suspicious of the brash New Yorker: If Trump wanted a club now, what would he ask for next?

Proposing an easement was a pre-emptive strike, said Alan Ciklin, a West Palm Beach zoning attorney who was among the lawyers representing Trump.

"It wasn't that they foisted the condition on us. ... We initiated the easement; it was not initiated by the Town Council," Ciklin told The Post.

During several meetings, council members quizzed the attorneys about the easement: When would Trumpdonate it? Whom would he donate it to? If they voted in favor of Trump's plan to turn Mar-a-Lago into a private club before Trump donated the easement, how could they be assured he would follow through?

To address some of those concerns, Trump selected the National Trust for Historic Preservation to ensure Mar-a-Lago's finest features would be maintained forever.

Such an act would have its reward for Trump. He could deduct the $5.7 million estimated value of those features from his income taxes -- as long as his intentions were charitable.

But Trump's promise couldn't be in writing, Trump attorney Rampell told the council, according to meeting minutes and transcripts. If the council insisted Trump's commitment be in writing, his donation might be disqualified by the IRS as a charitable contribution.

But Rampell couldn't get around the council's concerns. To appease them, he promised the club would not open until the easement was in place.

The Town Council wasn't convinced, and the easement became a sticking point that threatened to derail the deal.

Council members wanted the easement in place before they signed the final agreement. Trump wanted the signed agreement in place before he donated the easement.

"Suppose I put preservation easements in place and then they decide to not sign the agreement?" he told a Palm Beach Daily News reporter for a story published Aug. 1, 1993. "Nobody has ever accused me of being stupid."

They eventually came to an agreement: Trump could have his club, but the town wouldn't issue a certificate of occupancy for it to begin operations until the easement was in place.

"If there is one blade of grass out of order, there will be no certificate of occupancy," Councilwoman Hermine Wiener said at the July 1993 meeting.

It took two years, but ultimately Trump donated the easement, and the town let the club open.

'Plainly a quid pro quo'

Even though the promise to donate the easement wasn't in writing, it was still part of the agreement, tax experts and a former Mar-a-Lago manager said.

"That's plainly a quid pro quo," said John Echeverria, a Vermont Law School professor and former general counsel for the Audubon Society. The phrase means Trump got something in return for his donation.

Bill Hutton, a San Francisco-based lawyer who has handled preservation easements since the law was passed in 1969, said he had "no doubt" it was a quid pro quo.

"There really should be no serious question about whether they came to a deal," he said.

That's also how Wes Blackman, who was hired by Trump to be project director six months after the deal was approved, viewed it. He was responsible for making sure the conditions of the deal were met so the easement could be donated -- the club couldn't open without it, he said.

"That was a condition and requirement of the estate becoming a private club," said Blackman, who worked at Mar-a-Lago for 10 years.

Nancy McLaughlin, a University of Utah law professor, said it was not clear whether it was a quid pro quo. However, she said other court challenges to easement deductions have proved one thing: "Saying it was voluntary doesn't mean there wasn't a quid pro quo."

Ultimately, it would be left up to the U.S. Tax Court, she said.

Valuing the loss

To get the deduction, Trump hired appraisers to determine how much Mar-a-Lago's property value would drop because of the easement.

The appraisal by Chicago-based Clarion Associates pointed out that the easement places so many restrictions on the historic property that it would reduce the number of potential buyers if Trump ever decided to sell. Future owners could not change interior and exterior details and would be forced to meet strict restoration standards.

Clarion called the agreement "one of the most restrictive preservation and conservation easements that has ever been placed on a historic property in the United States."

The bigger the drop in value the appraisers identified, the higher the tax break for their client, Donald Trump.

The appraisal, completed in 1996, determined that before donating the easement, it was "highly likely" that Trump would gut some of the rooms, sell off its critical features and build homes on the property.

Among the $2.9 million in decor likely to be sold: seven antique needlework tapestries from a Venetian palace worth $100,000; about 3,000 square feet of Spanish tiles worth $30,000; and 10 shields bearing the Post and Merriweather coats of arms worth $25,000.

Clarion also calculated that Trump or a future owner had enough room to keep the mansion and subdivide the rest of the 17-acre property into eight additional home sites. But the easement required that two of those sites be preserved forever. That limited to six the number of new sites, valued in 1995 at no less than $1.8 million each, that could be built.

Since he or any future owner could no longer sell the antiques or build the two homes, among many factors, the appraisal concluded that the value of Mar-a-Lago was reduced from $25 million to $19.25 million.

That meant, the appraisal said, that Trump could deduct the difference -- $5.75 million -- from his personal income taxes.

Golf course tax breaks

When it comes to easements, Trump was ahead of his time.

They were seldom used until the late 1990s. It wasn't until The Washington Post in 2003 and 2004 exposed how the deductions were being abused that the IRS became aggressive, targeting inflated appraisals and donors with questionable intentions. Various easement abuses repeatedly made the IRS list of "Dirty Dozen Tax Scams."

The IRS has been especially watchful of people who take out easements on golf courses, which often provide nothing of value to the public or the environment.

Despite the scrutiny, Trump hasn't been shy about tapping his golf courses for tax savings.

Since the Mar-a-Lago easement, he was able to deduct $39.1 million from his 2005 federal income taxes under the terms of an easement that barred him from building houses on his golf course in Bedminster, N.J., according to The Wall Street Journal.

Trump also donated an easement for his Seven Springs estate in Westchester County, N.Y., according to the report. In 2015, Trump donated an easement on 11.5 acres of his Trump National Golf Course in Los Angeles.

According to records he gave The Associated Press in 2016, he donated nearly $64 million in easements between 2010 and 2015, bringing the total amount he donated to more than $100 million.

Echeverria, the tax expert, said that if Trump is being audited by the IRS, it "absolutely" could be because of his golf course easements.

Public records don't reveal how much Trump deducted for each easement or whether the IRS has challenged them. That can't be known without reviewing Trump's personal tax returns, which he has refused to make public.

Although tax breaks for easements for golf courses have long been considered a loophole that both former President Barack Obama and some Republicans wanted to close, Congress' recent tax bill does not touch conservation and preservation easements.

The IRS has declined to comment. Rampell would not comment for this story. The White House referred questions to the Trump Organization, which did not respond.

But Trump is proud of his tax prowess.

"I have brilliantly used those laws," Trump said during an October 2016 campaign rally in Pueblo, Colo. "I have a fiduciary responsibility to pay no more tax than is legally required. ... Or to put it another way, to pay as little tax as is legally possible."

Is Mar-a-Lago open to the public?

If Trump's deal with the National Trust had a drawback, it's that he must open Mar-a-Lago to the public.

But he found a way to get around it.

For one day a year, up to 100 members of the public must be allowed on the grounds of the estate for "viewing and study." On one other day, Trump must allow up to 20 members of the public into the mansion "for the purpose of viewing and studying the historic and architectural characteristics of the property."

So who are the lucky ones standing in long lines to get a glimpse within the lavish estate?

Socialites who pay up to $1,000 for tickets to charity galas. Friends of members and small groups invited in for weddings, lectures and luncheons.

And that's just fine with the National Trust.

"We are comfortable that the public access provisions of the easement (both exterior and interior) have been followed," said Paul Edmondson, the trust's chief legal counsel.

But McLaughlin, the University of Utah law professor, is not. Charity galas should not be considered public access, she said. Why should preservation easements allow donors to get "outrageous deductions" but provide no real public access, she asked.

"It really irritates me," McLaughlin said. "Charities have a responsibility to make sure these are benefiting the public ... and that it's not a wink and a nod."

cstapleton@pbpost.com Twitter: @StapletonPBPost