Gilead Sciences Inc. agreed to buy Forty Seven Inc. for about $4.9 billion to advance into one of the hottest areas of pharmaceutical research: cancer treatments that harness the immune system to fight tumors.

Gilead will acquire Forty Seven for $95.50 per share in cash in a transaction cleared by both boards, the Forster City, California-based company said in a statement Monday. The price is a 96% premium to Forty Seven’s closing price Thursday, before Bloomberg News broke the news of Gilead’s approach. Forty Seven’s shares rose 61% to $93.51 in trading before the market opened in New York.

Gilead’s hepatitis C franchise turned the company into a pharma industry giant, but sales of the drugs have slipped from their peak and it has struggled to find new streams of revenue. The deal with Forty Seven complements the 2017 acquisition of Kite Pharma, bringing an experimental therapy that has potential to be the first in its class, said Chief Executive Officer Daniel O’Day.

O’Day took the reins last March, saying one of his top priorities was to bolster Gilead’s drug pipeline.

Menlo Park, California-based Forty Seven received interest from other potential suitors, Bloomberg reported last week, citing people familiar with the company. The agreed price for the Gilead takeover includes options and warrants.

The company’s experimental medicine, called magrolimab, is a monoclonal antibody in early studies for several cancers affecting the blood and lymph nodes, including acute myeloid leukemia and diffuse large B-cell lymphoma.

The therapy targets a “do-not-eat-me” signal that allows cancer cells to avoid destruction. The drug blocks the signal, allowing the patient’s own immune system to engulf and eradicate the malignant cells.

Forty Seven also has two experimental medicines that may soon enter clinical tests, including an antibody that could be combined with magrolimab.

Citigroup Inc. and JPMorgan Chase & Co. acted as joint financial advisers to Gilead. Centerview Partners LLC is acting as the Forty Seven’s financial adviser. Skadden, Arps, Slate, Meagher & Flom LLP served as Gilead’s legal counsel and Cooley LLP did the same for Forty Seven.