AbbVie Inc. beat out Johnson & Johnson with a last-minute bid that clinched the $21 billion acquisition of Pharmacyclics Inc., gaining control of a blockbuster blood cancer therapy.

Deals for cancer treatments have been heating up. For more, see Cancer Drugs Spark Deal Possibilities

AbbVie, based in North Chicago, Illinois, will pay $261.25 a share using a mix of cash and its own stock, the two companies said. Pharmacyclics was nearing an agreement to be acquired by J&J, which was offering about $250 a share, before AbbVie topped the bid, said a person with knowledge of the matter who asked not to be identified as the details are private.

The purchase would help AbbVie reduce its reliance on Humira, its best-selling rheumatoid arthritis treatment, while expanding into the lucrative area of cancer therapy. It would gain control of Imbruvica, a pill that costs about $100,000 a year, avoids certain serious side effects of chemotherapy, and is already approved for four different blood cancer uses.

AbbVie’s price is 39 percent higher than Sunnyvale, California-based Pharmacyclics’s closing price on Feb. 24, the day before Bloomberg News reported that the company was considering a deal. Amy Jo Meyer, a spokeswoman at New Brunswick, New Jersey-based J&J, declined to comment.

Pharmacyclics had net income last year of $86 million, according to data compiled by Bloomberg. However, sales of Imbruvica are expected to grow to $3.56 billion in 2018 from $492 million last year, according to an average of estimates by analysts surveyed by Bloomberg, as it’s used in more types of cancer.

While Imbruvica will overlap with one of AbbVie’s top pipeline products, ABT-199, there should be room for both, said Asthika Goonewardene, an analyst with Bloomberg Intelligence. It may take until 2016 for ABT-199 to be approved, and while Imbruvica has shown itself to be a preferred drug for many patients, others may benefit from a different therapy. “Given all this, having two dogs in the race may not be a bad thing,” Goonewardene said in an e-mail.

AbbVie said it expects about 58 percent of the purchase to be paid in cash and the rest in stock, with the transaction closing mid-year. Its shares closed 1.1 percent higher at $60.27 in New York. Since splitting off from parent Abbott Laboratories in 2013, AbbVie hasn’t completed a megadeal that have tempted much of the rest of the drug industry.

It has tried, though. AbbVie and Shire Plc in October agreed to terminate a planned $52 billion acquisition by AbbVie that would have domiciled the drugmaker abroad and given it a lower tax rate. AbbVie pulled its support for the transaction after proposed changes to U.S. rules.

Forecasts

In January, AbbVie gave a forecast for adjusted 2015 earnings near the low end of analysts’ estimates as competition from generic drugs eats into profits. Pharmacyclics shareholders will get to choose whether to take cash, stock or a combination.

Pharmacyclics is partnered with J&J on Imbruvica. The drug could eventually be used in solid tumors, and Pharmacyclics also has a partnership with AstraZeneca Plc to develop the drug for use with a new type of oncology treatment that triggers the body’s immune system to attack tumors.

“We’re looking forward to continuing our collaboration with the team at AbbVie to further develop and commercialize this important therapy,” J&J said in an e-mailed statement, referring to Imbruvica.

Acquisitions by pharmaceutical and biotechnology companies reached a record $239 billion last year, according to data compiled by Bloomberg, as buyers from Actavis Plc to Bayer AG picked up new assets.

Morgan Stanley was the financial adviser, while Wachtell, Lipton, Rosen & Katz served as legal counsel to AbbVie, according to the statement. Centerview Partners LLC and JPMorgan Chase & Co. were the financial advisers to Pharmacyclics, and Wilson Sonsini Goodrich & Rosati provided it legal advise.

Other deals for cancer drugs have come from Valeant Pharmaceuticals, which is buying bankrupt Dendreon, and Merck, which agreed to buy OncoEthix.