Sen. Bernie Sanders (I-Vt.) in Philadelphia on Thursday. (Matt Rourke/Associated Press)

SUDDENLY, AND quite improbably, free trade between the United States and tiny Panama is the hot issue on the Democratic side of the presidential campaign, with Sen. Bernie Sanders (I-Vt.) calling an Obama administration-backed tariff-slashing pact that took effect four years ago “a disaster.” His complaint is not the usual one about job-killing trade deals; after all, the United States has a multibillion-dollar trade surplus with Panama, just as it did before the pact. This time, Mr. Sanders blames the trade deal for Panama’s allegedly booming offshore banking business for wealthy international tax-avoiders, which has just been exposed in leaked records known as the Panama Papers.

“I predicted that the passage of this disastrous trade deal would make it easier, not harder, for the wealthy and large corporations to evade taxes by sheltering billions of dollars offshore,” Mr. Sanders said in a news release. “I wish I had been proven wrong about this, but it has now come to light that the extent of Panama’s tax avoidance scams is even worse than I had feared.” Quite a contrast, he says, with Hillary Clinton, who helped push the deal through Congress as Mr. Obama’s secretary of state.

The evidence, however, suggests that the truth is pretty nearly the opposite of what Mr. Sanders claims — and our source for that is the Panama Papers themselves.

Data culled from the documents by the International Consortium of Investigative Journalists, and presented in several charts on the group’s website, show that the Panama-based law firm Mossack Fonseca, which specialized in setting up offshore accounts and shell companies for wealthy people, has been steadily reducing its activity in Panama for about a decade. As it happens, the decline began about the time the Bush administration and Panama began discussing a free-trade pact — and accelerated after the deal took effect during Mr. Obama’s first term.

Specifically, the number of offshore incorporations fell from 4,741 in 2005 to 835 in 2015. Most important, as of last year Mossack Fonseca appeared to have nearly completely ceased incorporating the least transparent form of company — known as “bearer shares” — which often don’t need to register an owner’s name.

The Panama Papers consist of 11.5 million documents from Panama-based law firm Mossack Fonseca. The papers apparently implicate a number of high-profile global figures in potentially illegal financial activities. (Deirdra O'Regan/The Washington Post)

Even before the free-trade deal, Panama was under pressure from both the United States and Europe to clean up its tax-haven act; the pressure intensified after the financial crisis of 2008. The Obama administration, backed by members of Congress, made it clear the free-trade deal — which Panama badly wanted, to match a deal between its Central American neighbors and the United States — hinged on a separate agreement granting U.S. tax authorities more access to Panama’s financial system. The United States particularly insisted on plugging the “bearer shares” loophole. Panama agreed and changed its laws accordingly — before the free-trade agreement reached the Senate and Mr. Sanders nevertheless voted “no,” claiming, wrongly, that it would make the tax haven “worse.”

In response to our questions, the Sanders campaign didn’t address the data, but said the administration had missed an opportunity to completely “eradicate” the Panama tax haven. To us, it looks like the Obama administration’s diplomacy resulted in real progress, and that if anyone’s entitled to say “I told you so” about that, it would be Ms. Clinton.