We learned weeks ago from the New York Times’s disclosure of Donald Trump’s 1995 income tax documents that he filed nearly a billion dollars’ worth of business losses that could have been used to offset 18 years’ worth of personal income tax liabilities. We then learned from Trump’s reaction to the story that he had, in fact, gone years without paying federal income tax. But that gave rise to a new mystery. Trump did not have $1 billion in cash to lose. What happened is that his casinos went bankrupt and he secured massive relief from his creditors, making bondholders share in his misfortune.

Forgiven debts, however, are supposed to show up as taxable income. So how did Trump pull it off? New legal documents obtained by the New York Times indicate that Trump filed the transaction as a ‘‘debt for equity swap,’’ a move that allowed him to not count hundreds of millions of dollars in debt relief. His lawyers told him the IRS would probably not allow this move (and maybe it didn't), but we do know from legislative history that the loophole remained arguably on the books until Congress explicitly closed it in 1993.

Since Trump continues to refuse to engage in routine tax disclosure, it’s impossible to say exactly what happened after that. But the hint that he used a tax minimization strategy his lawyers advised against is further evidence that an investigation of his management of his foundation could lead to criminal charges.

The story also serves to directly refute Trump’s repeated claim that if you don’t like tax loopholes you should blame insider politicians like Hillary Clinton rather than millionaires like Trump who took advantage of them. Bill Clinton’s administration tried to shut down this loophole, and then when aggressive lawyers found a way to reopen a smaller version of it, Hillary Clinton voted in the Senate to close the new version too. But in the meantime, Trump seems to have avoided paying any taxes on millions in income.

The art of the debt-for-equity swap

If you owe bondholders $100 million but you can’t pay them and you renegotiate your debts so that you only owe them $60 million, the $40 million in debt relief you received is supposed to go down on your taxes as income.

So in the early 1990s when the collapse of the junk bond market led many companies to go bust and renegotiate their debts, clever tax attorneys came up with a workaround. Instead of simply “forgiving” the $40 million in debt, the debt could be traded for shares of stock in the company — shares that had little to no value because the company was bankrupt. Thus, $40 million in income could vanish with the stroke of a pen.

That’s pretty dumb, so in 1993 Congress and the IRS acted to definitively disallow this move.

What happened next was that some companies that were organized as partnerships decided that because they were partnerships rather than broadly held companies, Congress hadn’t really closed the loophole on them. You could still execute the exact same debt-for-equity swap that Congress had disallowed but say it hadn’t really been disallowed because you were swapping debt for partnership equity rather than shares of stock in a publicly traded company.

Trump’s casinos were organized as partnerships at the time (he later transferred them to a publicly traded company he used as a vehicle to bilk middle-class investors out of millions of dollars), and back in 1991 he proposed to his lawyers a version of the debt-for-equity swap that he hoped would get him out of paying taxes on millions of dollars in income.

Trump’s lawyers said his plan probably wouldn’t fly

People proposing audacious tax moves normally seek a formal letter from well-qualified tax attorneys before filing their taxes. One important reason for this is that the standard for criminal tax evasion involves mens rea, knowledge that your activity was unlawful. If you have formal legal advice from a well-qualified attorney stating that your tax avoidance gambit was legal, then you are in the clear, legally speaking, even if the IRS decides the lawyers were wrong and your gambit is disallowed. You’ll still have to pay the taxes you owe, obviously, but you’re not guilty of anything other than bad paperwork.

Tax lawyers assess these matters according to a specific code. That the IRS “should” allow something means there’s a 75 percent chance it will fly. “More likely than not” means a 51 percent chance. Trump’s lawyers told him some key details of the plan were unlikely to be approved:

One letter, 25 pages long, analyzed seven distinct components of Mr. Trump’s proposed tax maneuver. It found only “substantial authority” for six of the components. In the stilted language of tax opinion letters, the phrase “substantial authority” is a red flag that the lawyers believe the I.R.S. can be expected to rule against the taxpayer roughly two-thirds of the time. In other words, Mr. Trump’s tax lawyers were telling him there were at least six different reasons the I.R.S. would probably cry foul if he were audited. In anticipation of that possibility, the lawyers even laid out a fallback plan that would have allowed Mr. Trump to spread the pain of a large tax hit over many years if the I.R.S. ultimately balked.

We don’t know exactly what happened next. We do know that when Hillary Clinton accused him of avoiding all federal income taxes for years, Trump replied, “That makes me smart,” and that in subsequent statements Trump surrogates emphasized that he has paid many other taxes over the years, including property taxes on his real estate holdings and employer-side payroll taxes for his workers.

So while it’s impossible to say for sure, it appears that Trump went forward with a bold strategy his lawyers said the IRS probably wouldn’t allow but then it allowed it anyway, and then Congress closed the loophole he exploited some years later.

Why does this matter?

On a broad level, Trump’s use of egregious tax loopholes speaks to broader themes of an economic playing field that is unfairly tilted to favor the already rich — people like Trump who can built a real estate empire on millions of dollars in loans from his dad.

More specifically, Trump has tried to point to the very existence of these loopholes as an example of Clinton’s ineffectiveness as a legislator.

“Why didn’t she ever try to change those laws so I couldn’t use them?” he asked at a campaign rally in October when his earlier tax documents were widely discussed in the press.

It turns out that she did. It was during her husband’s presidency in 1993 that Congress and the IRS first moved to close the debt-for-equity swap loophole, and in 2004 she was one of the senators who voted to definitely close the partnership version of it.

The fact that Trump seems to have gone moderately against the advice of his own tax lawyers, meanwhile, is more grist for the mill that there should be a criminal inquiry into the Trump Foundation. Public reporting, mostly from the Washington Post’s David Fahrenthold, makes it seem overwhelmingly likely that the foundation was violating various aspects of nonprofit law and that Trump probably owes back taxes related to the foundation. Whether there is any criminal culpability in that hinges on what Trump knew and how well he understood what he is doing.

He has previously boasted publicly of his extensive and detailed knowledge of the tax code, which seems like a good prima facie reason to at least look into it a little. And the New York Times’s latest revelations show a man who was deliberately and knowingly aggressive in his tax strategies in other realms of his personal finances, intentionally pushing forward with a strategy his lawyers said would likely be disallowed. It’s impossible to say anything definitive about any of this without access to more documents, but given Trump’s lack of voluntary disclosure, at least a preliminary investigation would be needed to gain access to them.