Donald Trump’s claim that he was smart for figuring out how not to pay federal income taxes was obnoxious when he said it, at least for the millions of Americans who pay their fair share. Now we learn that he was able to avoid some of those taxes decades ago with a tactic that is illegal now and was highly dubious even then.

In the 1990s, with his Atlantic City casinos and other businesses tottering on the verge of collapse, Mr. Trump negotiated a deal under which his creditors — investors and banks — would forgive part of the debt in exchange for equity in partnerships he controlled. Without such swaps, Mr. Trump would have had to report the forgiven debt as income, offsetting a big portion of the $916 million loss he claimed on his tax return in 1995. That loss allowed him to avoid paying taxes for up to 18 years.

It is impossible to know whether the Internal Revenue Service challenged Mr. Trump’s use of the swaps because, unlike every major party presidential nominee for nearly 40 years, he refuses to release his tax returns. But as The Times reported on Monday, the maneuver was so suspect that his lawyers advised against it.

And it’s clear that even then tax officials and federal lawmakers were hoping to end the practice because it allowed businesses and rich individuals to avoid taxes by swapping forgiven debt with equity that was worth little or nothing. Indeed, even as Mr. Trump’s lawyers were advising him against this approach, one tax expert wrote that trying to find legal support for it was like trying to find evidence for “the existence of the Loch Ness monster.”