WASHINGTON — Donald Trump avoided paying potentially hundreds of millions of dollars in taxes in a way even his own lawyers considered questionable, The New York Times reported Monday.

The newspaper said the maneuver, which was eventually banned by Congress in 1994, also may explain how Trump posted a one-year loss of more than $900 million a few years later, enabling him to avoid paying federal income taxes for perhaps 18 years.

Using the maneuver, Trump might have escaped paying tens of millions of dollars in personal income taxes, the report said, but there’s no way to know for sure since he has refused to release his tax returns.

Get Breaking News Delivered to Your Inbox

At issue is how Trump was able to cancel hundreds of millions of dollars of debt as his casino empire in Atlantic City went broke in the early 1990s. Canceled debt generally is treated as taxable income, meaning Trump would have owed the Internal Revenue Service significant money on debt that his creditors forgave.

The Times said it obtained documents from a quarter-century ago showing Trump essentially traded the debt relief for nearly worthless “partnership equity” to avoid any tax liability. In practice, the strategy was almost identical to a tax maneuver that was already outlawed, but differed in minor details. Trump’s own lawyers advised him the IRS would likely find it improper if he were audited, the paper said.

Tax experts told the Times that the maneuver used resulted from unclear provisions of highly technical tax court rulings, the report said, which also added that it was a new twist on something corporations had been relying on for years to avoid taxes that resulted from canceled debt.

Trump declined to comment on the story, the report said, but his spokeswoman Hope Hicks provided a very critical statement.

“Your email suggests either a fundamental misunderstanding or an intentional misreading of the law,” Hicks said.“Your thesis is a criticism, not just of Mr. Trump, but of all taxpayers who take the time and spend the money to try to comply with the dizzyingly complex and ambiguous tax laws without paying more tax than they owe. Mr. Trump does not think that taxpayers should file returns that resolve all doubt in favor of the I.R.S. And any tax experts that you have consulted are engaged in pure speculation. There is no news here.”

Hillary Clinton, when she was a New York senator, was among the lawmakers who voted to close the loophole.