AbbVie Inc through its last minute bid clinched the acquisition for $21 billion for Pharmacyclics, Inc and gained control of blood cancer therapy.

North Chicago, Illinois based AbbVie will pay a per share price of $261.25 using a mix of stock and cash, said the two companies today.

Pharmacyclics was closing in on agreement with J&J to be acquired, which offered $250 per share, before the bid by AbbVie came in, said a source close to the company.

The cancer therapy purchase by AbbVie will lower its reliance on its best selling treatment for rheumatoid arthritis Humira, while moving into cancer therapy, which is a highly lucrative area.

The deal will give AbbVie control of Imbruvica, which is a pill that costs nearly $100,000 per year, avoids some side effects that are serious from chemotherapy and has already received approval for four blood cancer uses.

The price offered by AbbVie is 39% higher than Pharmacyclics price at closing February 24, the day prior to a report that the business was considering a deal.

Pharmacyclics recorded net income of $86 million last year. However, sales of the cancer treatment Imbruvica are projected to increase to more than $3.56 billion in 2018 from last year’s $492 million.

While Imbruvica overlaps with one of the top products of AbbVie, ABT-199, there will be room for each of them, said one analyst. It might take another year for ABT-199 to receive its approval and while the cancer drug Imbruvica is the preferred drug for a great deal of patients, others might benefit for another type of therapy.

AbbVie said it was expecting close to 58% of the price of the acquisition to be paid through cash and the rest via stock. The company expects the deal to close sometime during the middle of this year. Shares of AbbVie were up 1.1% in early trading on Thursday.

Since making a split from Abbott Laboratories back in 2013, AbbVie had not completed a huge deal that has tempted much of the remainder of the drug industry.