A U.S. Treasury Department crackdown is demonstrating the risks of joining the wave of corporate tax inversions too late.

Another sign came as Illinois drugmaker AbbVie Inc. said this week that it’s on the verge of canceling its $51 billion takeover of Shire Plc, which would be the largest inversion on record. Two other U.S. companies had already dropped plans to shift their legal addresses to lower-tax countries since the Treasury Department announced tougher rules on Sept. 22.

Exempt are those companies that completed deals before the Treasury announcement, obtaining a durable tax advantage over their U.S.-domiciled peers.

“We’re going to create two classes of companies, based upon a date,” said Bret Wells, a professor at the University of Houston Law Center. “Some companies get a better answer than others based on when they engaged in tax planning.”

The cancellations show that the Treasury rules, which Treasury Secretary Jacob J. Lew and President Barack Obama sought to ward off more inversions, are having an effect -- even after some tax experts criticized the measures as not going far enough. One congressional estimate in May predicted that, without a law change, the deals could cost the U.S. government $19.5 billion in forgone tax revenue over the next decade.

Some Republicans have warned that rules targeting inversions without addressing the fundamental tax advantage held by foreign-owned firms will only encourage more takeovers of U.S. companies.

One of the companies that canceled an inversion deal this month, Auxilium Pharmaceuticals Inc., instead agreed to be sold to Endo International Plc, which beat the Sept. 22 deadline by becoming Irish in February.

The contrast between inverted companies and those left behind is starkest in the U.S. drug industry, where many of the recent inversion deals are centered. Companies including Pfizer Inc. and AbbVie have complained that their U.S. domicile puts them at a disadvantage to foreign competitors that pay lower corporate tax rates.

U.S. companies that have completed inversion deals, including Valeant Pharmaceuticals International Inc. and Actavis Plc, are using their tax advantage to gain an edge in acquisitions. One Illinois drugmaker, Horizon Pharma Plc, finished obtaining an Irish address just three days before the rule change.

AbbVie became convinced, after recent talks with Treasury and Internal Revenue Service officials, that the loss of some tax benefits and the related prospect of having to borrow more to take over Shire had eroded the attractiveness of the deal, said people familiar with the matter.

AbbVie is also concerned that possible further changes to U.S. laws may increase future tax bills, the people said, asking not to be identified discussing a private matter.

The North Chicago, Illinois-based drugmaker’s board -- which said Oct. 14 it is reconsidering its endorsement of the purchase -- is almost certain to rescind that backing when it meets Oct. 20, the people said.

The urge to invert is spurred by the U.S. tax code, which favors foreign-owned companies over domestic ones. U.S. companies pay a 35 percent income tax rate, the highest in the developed world, and must pay that rate on foreign income if they return it to the U.S. Foreign-owned companies aren’t required to pay U.S. tax on their non-U.S. income.

About 45 companies have completed inversions since the first one in 1982, with eight deals now pending, including AbbVie’s.

Most deals in the current crop of transactions involve obtaining a foreign address through a takeover of a smaller company in another country. In most cases, the company’s top executives stay in the U.S. -- only the taxes depart.

The Sept. 22 notice hardly spells the end of inversions. Five of the eight inversion deals pending at the time of the Sept. 22 notice remain on track to be completed, and two new ones have since been announced.

Future inversions will probably involve mergers in which tax savings play a much smaller role, said Edward Tanenbaum, a partner at Alston & Bird LLP in New York.

“There’ll be more of an emphasis on the commercial and business reasons for these inversions,” he said. “A lot of companies planning these inversions purely on their tax effect, obviously they will think twice.”

Inversions tend to come in waves, and at some point companies are likely to find new ways to make tax-advantaged deals without running afoul of the rules, said Laurence Bambino, a partner at Shearman & Sterling LLP in New York.

“For the next year, you’ll see people digesting this and waiting to see the regulations they plan to write, and then I’m sure there will be some intrepid companies that will decide they want to take this on again,” he said.

The canceled inversions take pressure off Congress to address the issue through legislation, as Obama and some Democratic lawmakers have urged. Democratic senators including Carl Levin of Michigan and Charles Schumer of New York have proposed bills that would limit companies from inverting by buying smaller companies, something that the Treasury rules don’t prohibit.

“A lot of congressmen and senators would probably say they’ve put a dent in it, we don’t need to deal with it right away, we’ll deal with it down the road when we do comprehensive tax reform,” Tanenbaum said.