Allergan, the drugmaker that emigrated to Ireland to avoid U.S. taxes in 2015, is now coming home — at least partially.

Allergan’s income will generate some U.S. taxes because of a deal announced Tuesday for AbbVie Inc. to acquire the Dublin-based company, even though it will remain in Ireland.

Even the partial homecoming represents a win for U.S. lawmakers and regulators who have spent years trying to stop companies from moving their headquarters abroad to largely avoid taxes.

The $63 billion AbbVie acquisition is a big shift from 2015, when Allergan made moves to escape the U.S. tax net. The company underwent a complicated transaction known as a corporate inversion, in which it was acquired by Actavis, a smaller Irish drugmaker. Allergan continued to be managed from New Jersey but was able to use its Irish address for tax purposes, where the corporate rate is 12.5%.

“Unlike an inversion where U.S. income is transformed into foreign income, in the instant case, the polar opposite may well occur — since, here, foreign income might be transformed into U.S. income,” Robert Willens, an independent tax consultant, said Wednesday in a note to clients.

A few years ago, this deal would likely have gone differently — Allergan would be the one buying AbbVie. In fact, Allergan tried this type of inversion with Pfizer in 2016, but the Treasury Department wrote regulations that effectively killed the deal.

The merger makes Allergan a special type of entity, known as a controlled foreign corporation, AbbVie spokeswoman Adelle Infante said. And under the 2017 Republican tax law that means Allergan will likely pay U.S. tax on some of its income, but not at the full 21% corporate rate.

The 2017 tax overhaul cut the rate from 35% to 21% and killed off nearly all remaining reasons for companies to invert. But Allergan will likely have to pay a new tax in the law on what is known as global intangible low-taxed income, or Gilti, said Albert Liguori, managing director at consulting firm Alvarez & Marsal Taxand.

“Allergan is now returning to become globally subject to U.S. tax rules,” he said. But “it may not necessarily mean a profound amount of tax.”

AbbVie — based in North Chicago, Illinois — currently pays well below the new 21%, and said it will have an effective rate of 9% this year. Its future rate will rise to only 13%, the company said.

But the deal demonstrates that companies that have moved offshore aren’t looking to become permanent U.S. residents again, as President Donald Trump has promised.