President Obama’s campaign to stop American companies from heading overseas to avoid U.S. taxes scored its biggest win yet Wednesday when pharmaceutical giant Pfizer called off a $160 billion merger with Dublin-based Allergan.

The sudden collapse of the deal comes just days after the Treasury Department made a rule change that appeared to be aimed specifically at the transaction, stripping it of many of its benefits. The deal would have relocated Pfizer’s headquarters to Ireland and shaved billions offits tax bill, taking advantage of a practice that Obama this week called “one of the most insidious tax loopholes out there.”

Criticism of corporations that use overseas deals to avoid high U.S. taxes — a strategy known as “inversions” — has never been more pitched in Washington and out on the campaign trail. But the victory by the Obama administration is not expected to put an absolute stop to the practice.

Lawmakers on both sides of the aisle say the only sure way to stamp out inversions is comprehensive tax reform, which has proved to be a fraught issue between Democrats and Republicans on Capitol Hill. Until then, business groups complain that the government is cherry-picking its battles and injecting new uncertainty into the rules governing global trade.

Many executives — who have remained largely silent in the face of the fiery, populist rhetoric of the presidential campaigns — are preparing to take their grievances to Congress, where they hope to wield more influence.

“I don’t think companies should be intimidated by government,” said Sen. Orrin G. Hatch (R-Utah), chairman of the tax-writing Senate Finance Committee. “On the other hand, yeah, I’m glad to see Pfizer stay here, and I’m going to try and find a way whereby we can do this legitimately so they want to stay here.”

Voter anger over the power wielded by large corporations gave the Obama administration an opening to act more aggressively than many had expected, industry officials and tax experts said. Democratic presidential candidates Hillary Clinton and Bernie Sanders have criticized the Pfizer deal at numerous campaign stops this year, and they each cheered the news Wednesday.

“They call it an inversion. I call it a perversion,” Clinton said in remarks at a Pennsylvania AFL-CIO convention.

The deal, the largest proposed inversion in history, was projected to save Pfizer about $35 billion in taxes.

But late Monday, the Treasury Department announced new rules that changed the calculus for how certain inversions would be treated by the tax code. Less than 48 hours later, Pfizer and Allergan determined the change meant that the tax benefits they had anticipated would be more difficult, if not impossible, to achieve.

“For the rules to be changed after the game has started to be played is a bit un-American,” Allergan chief executive Brent Saunders said in an interview with CNBC on Wednesday morning.

The Treasury Department’s new regulations still allow inversions in some cases, although many companies may be reluctant to test the agency’s resolve. And it leaves what Republicans and Democrats agree is a broken corporate tax code that saddles U.S. companies with the highest tax rate in the developed world, 35 percent.

The United States is now becoming one of the world’s largest tax and secrecy havens. Here's why. (Daron Taylor/The Washington Post)

“What we’re doing is starting to contain the virus, the inversion virus,” said Sen. Ron Wyden (Ore.), the ranking Democrat on the Finance Committee. “We still have to come up with a cure, and that’s what’s going to take legislation.”

The corporate tax rate of 35 percent was once among the lowest in the developed world, but over the past three decades, other countries have steadily reduced their rates, inviting corporations to relocate.

“What companies [are] doing when they’re inverting is trying to fix their own tax situations by self-help where Congress has failed to do anything — even though it’s been talking about it for a long time,” said Michael Graetz, a tax expert at Columbia Law School.

Over the past 20 years, inversions have become particularly popular for companies with a lot of foreign profits. Instead of bringing those profits back to the United States, where they would be taxed at a high rate, companies leave them overseas. The amount of unrepatriated profits reached $2.4 trillion last year, according to the advocacy group Citizens for Tax Justice, allowing companies to avoid up to $695 billion in taxes.

Pfizer had $193 billion in unrepatriated income last year, and moving its headquarters to Ireland would have made it easier for the New York-based firm to access that income without paying U.S. taxes.

Inversions typically involve larger U.S. companies merging with a smaller overseas partner and locating there. Tax experts say the new Treasury Department rules may lead some companies to forgo inversions in favor of breaking themselves up in parts that can be sold to larger foreign buyers, again shielding themselves from U.S. taxes.

There are still plenty of inversions under consideration. Milwaukee-based Johnson Controls announced this year that it would merge with Tyco International and move to Ireland, saving the firm about $150 million a year in taxes, for example. Last month, Colorado-based data provider IHS announced a $13 billion merger with London-based Markit that is expected to provide a tax savings of up to $270 million.

Meanwhile, broader efforts to reform the corporate tax code are stuck in legislative limbo.

Some lawmakers believe companies should be paying less, while others believe they should be paying more. Lowering the tax rate without plugging the abundance of tax loopholes could be a fiscal disaster, while harmonizing the U.S. tax system with the rest of the world could take years, legislative staffers say.

“Fundamentally, it all comes down to how do you pay for it,” said Frank Clemente, executive director of the advocacy group Americans for Tax Fairness.

At the time their deal was announced, both Pfizer and Allergan stressed that the tax benefits were not the only reason for the deal. But Pfizer had tried an inversion before, when it sought to buy the British drugmaker AstraZeneca in 2014. And both firms quickly soured on the union once the tax benefits were cast in doubt. Pfizer agreed to pay Allergan a $150 million breakup fee.

Many in the business community expressed concern that the administration appeared to target a specific deal rather than adopt a broader remedy.

“This is particularly arbitrary,” said Bruce Josten, executive vice president for government affairs at the U.S. Chamber of Commerce. “This isn’t tax policy. It’s punitive. It’s paranoia, and it totally misses the target.”

In numerous appearances Wednesday, Allergan’s chief executive expressed frustration with the new Treasury Department rules that appear to have derailed the deal.

“Everybody’s talking about walls. The Treasury is building a wall around the U.S.,” Saunders said in a conference call with investors. Saunders, an American, has emphasized that Dublin-based Allergan invests heavily in the United States, including through its research and development programs.

“I’m patriotic. I don’t want to get on a soapbox, but I think it’s incredibly misguided and unproductive policy for the United States,” he said.

Mike DeBonis, Anne Gearan and Jim Tankersley contributed to this report.