AbbVie Inc. agreed to buy Shire plc for 32 billion pounds ($54.8 billion), becoming the largest U.S. company to ever take a foreign address to lower its taxes.

Shire holders will receive cash and stock valued at 52.48 pounds a share, the companies said in a statement today. The price is 53 percent above Shire’s closing level on May 2, before AbbVie made its first takeover proposal.

AbbVie becomes the latest U.S. health company to move abroad amid a record period of pharmaceutical deals. The agreement will move North Chicago, Illinois-based AbbVie’s tax residence, though not its operations, to the U.K. in a so-called tax inversion, dropping its tax rate in 2016 to 13 percent from 22 percent. Shire’s drugs for attention deficit hyperactivity disorder and rare diseases will diversify AbbVie’s portfolio, dominated by the rheumatoid arthritis medicine Humira.

Analysts asked if the deal was done primarily for tax reasons. “This is a transaction that we believe has excellent strategic fit, well beyond the tax impact,” AbbVie Chief Executive Officer Richard Gonzalez said on a conference call discussing the deal. “We wouldn’t be doing it if it was just for the tax impact.”

The deal caps AbbVie’s 2 1/2-month pursuit of Shire, which rejected four earlier proposals.

Pfizer Inc.’s $117 billion failed bid this year for London- based AstraZeneca Plc kicked off a surge of acquisition activity among companies seeking lower taxes. Not including the AbbVie offer, there were deals proposed or completed worth $264 billion in the second quarter, according to data compiled by Bloomberg, five times more than any quarter since at least 2009.

“It’s very, very sweet for Shire,” said Guillaume van Renterghem, an analyst at UBS AG in London. “The beauty of this AbbVie-Shire deal is that everybody gets out of this deal in even better shape than they entered it.”

AbbVie was split off from Abbott Laboratories in January of last year, creating a brand-drug company out of the larger healthcare conglomerate that’s now focused on medical devices and nutrition products.

Abbott was involved in a tax inversion this month as well, selling part of its off-patent drugs business to Mylan Inc., allowing the generic drugmaker to shift its legal address abroad.

Negotiating teams from both companies met yesterday at the law offices of Davis Polk & Wardwell in New York to finalize terms and announce a deal, said a person with knowledge of the matter who asked not to be identified discussing private information.

Shire’s board said July 14 it would be willing to back AbbVie’s latest offer, and that negotiations were about issues other than price. Shire holders will receive 24.44 pounds in cash and 0.896 of an AbbVie share for each Shire share.

The combined company will have 15 drugs in the last of three stages of testing typically required before U.S. approval, Gonzalez said.

Shire rose 3.2 percent to 49.60 pounds at 2:45 p.m. in London. Before today, the stock had surged 69 percent this year amid speculation the company would be acquired. AbbVie fell less than 1 percent to $53.32.

The U.S. government has been scrutinizing tax inversions, and Senator Ron Wyden, a Democrat from Oregon, is proposing a bill that would make them more difficult to do. In the negotiations, Shire sought protection in case the U.S. passes a law that undercuts AbbVie’s tax benefits and puts the deal’s closing at risk, said two people with knowledge of the matter.

Gonzalez said the U.S.’s high corporate tax rate of 35 percent was pushing companies abroad. “Companies like ours need access to our global cash flows,” he said on the conference call. “Today we’re at a disadvantage compared to our foreign competitors, and that’s the debate we should be having around inversions and out tax code.”

U.S. government action or legislation to stop tax inversions by companies probably wouldn’t halt the deal, he said. “We’ve looked carefully at that aspect and we believe its executable.”

Since January 2012, at least 20 U.S.-registered companies have announced or attempted deals to shift their legal addresses overseas and lower their tax rates, according to data compiled by Bloomberg.

The agreement calls for AbbVie to pay Shire a breakup fee of 3 percent of the deal’s value, or about $1.6 billion, or reimburse costs of not less than $500 million, if the purchase fails to go through, according to the statement.

Gonzalez and his executive team won’t move out of the U.S. While Shire is based in Dublin for tax purposes, its main executive offices are in Basingstoke, England, and Chief Executive Officer Flemming Ornskov works in Lexington, Massachusetts. AbbVie has said the combined company’s tax domicile will be in the U.K.

Ornskov will lead the combined company’s rare-disease unit from Switzerland, reporting to Gonzalez. “Flemming is committed to staying post-close, as he would go through the integration process. I’ve had a number of discussions with him, he’s excited about role he’ll play with the new company.”

Flemming will also receive $9.9 million as part of a retention arrangement for senior Shire employees, amounting to about 150 percent of his annual total compensation. Two Shire directors, Chairwoman Susan Kilsby and Dominic Blakemore, will join the AbbVie board.

The tax move is only the industry’s latest.

Mylan said July 14 it will buy Abbott Laboratories’ generic-drug business and incorporate the new company in the Netherlands. Medtronic Inc., a Minneapolis-based medical-device maker, on June 15 announced a $42.9 billion takeover of Dublin- based Covidien Plc.

Pfizer’s bid for AstraZeneca Plc -- which would have been the largest in industry history -- ran into the U.K. Takeover Panel’s deadline as the companies couldn’t agree on a price.

A congressional panel estimated this year that a bill to prevent future inversions proposed by Representative Sander Levin, a Michigan Democrat, would preserve $19.5 billion in otherwise forgone tax revenue over the next 10 years.

AbbVie will gain a series of rare disease drugs, including Elaprase for Hunter syndrome, a genetic disorder, and Replagal, to treat Fabry disease. It also inherits experimental products, including lifitegrast for dry eye, and Premiplex for a potentially blinding eye disorder in infants. Premiplex could generate more than $1 billion annually if it reaches the market, said Jason Gerberry, an analyst at Leerink Partners.

Drugs for attention deficit disorder, including Vyvanse and Adderall XR, accounted for about 39 percent of Shire’s revenue last year.

JPMorgan Chase & Co. is advising AbbVie on the deal, while Citigroup Inc., Deutsche Bank AG, Evercore Partners Inc., Goldman Sachs Group Inc. and Morgan Stanley are advising Shire.