AstraZeneca P.L.C. agreed to buy a 55 percent stake in Acerta Pharma BV for $4 billion to gain a potential blockbuster medicine for blood cancer.

The United Kingdom's second-largest drugmaker will pay $2.5 billion up front and an additional $1.5 billion when Acerta's experimental drug acalabrutinib is approved by a regulator or at the end of 2018, whichever comes first, according to a statement released Thursday. The agreement also includes options through which London-based AstraZeneca can buy the rest of closely held Acerta for about $3 billion.

(AstraZeneca has operations in Fort Washington and Wilmington.)

The deal gives chief executive officer Pascal Soriot another promising new medicine as he seeks to bolster investors' confidence after having turned down a takeover bid from Pfizer Inc. last year. The company is also faced with generic competition for its blockbuster drugs Crestor and Nexium. Acerta's acalabrutinib, a rival of AbbVie Inc. and Johnson & Johnson's drug Imbruvica, may garner annual sales of more than $5 billion at its peak, according to AstraZeneca.

"By taking an equity stake in Acerta, we are completing the four main pillars of our oncology strategy: breast, ovarian, lung, and hematology," Soriot said in a media conference call. More broadly, the deal strengthens the company's ambitions to be a leader in the areas of cancer, respiratory disease, heart disease, and diabetes, he said.

AstraZeneca has struck several deals lately to replenish its pipeline. The company announced two transactions designed to beef up its operations in China and Japan on Wednesday. Last month, it agreed to buy ZS Pharma for $2.7 billion in cash, scooping up another potential blockbuster, this one for a deadly blood condition called hyperkalemia. That followed a deal with Celgene Corp. to collaborate on developing a drug for a range of blood cancers.

The Acerta deal will probably curtail AstraZeneca's earnings until 2018 because of the need to invest in clinical trials and regulatory submissions for acalabrutinib and bolster them starting in 2019, Jo Walton, an analyst at Credit Suisse Group AG, wrote in a note to clients. Compared with the $21 billion that AbbVie paid when it bought Imbruvica's developer Pharmacyclics Inc., an overall price of $7 billion looks "very reasonable," she said.

The deal gives AstraZeneca a late-stage medicine to treat patients across a range of blood cancers and maybe more. The drug also shows promise against autoimmune diseases in which the body attacks itself, such as lupus.

Like Imbruvica, acalabrutinib belongs to a class of drugs called Bruton's tyrosine kinase inhibitors, which work by blocking the BTK enzyme from promoting proliferation and survival of malignant cells. It is now in the most advanced phase of clinical tests for blood cancers and in earlier trials for multiple solid tumors, AstraZeneca said.

In an earlier trial, it worked on a deadly form of leukemia with milder side effects than Imbruvica. Other drugmakers developing BTK inhibitors are Eli Lilly & Co. together with Hanmi Pharmaceutical Co. Ltd. and Germany's Merck KGaA.

Imbruvica, a pill first approved by U.S. regulators in 2013, is projected to be a blockbuster with annual sales surpassing $8 billion by 2020, according to analyst estimates compiled by Bloomberg. Yet as many as 30 percent of patients stop treatment due to side effects such as severe bleeding, skin rashes, and diarrhea, said Susan Galbraith, who heads AstraZeneca's oncology unit. Early tests suggest acalabrutinib is better tolerated, she said on a conference call.

Following the flow of recent deals, AstraZeneca will be focused on its now-enhanced portfolio of drugs and is unlikely to announce more deals of Acerta's size, Soriot told analysts on a conference call. Still, the drugmaker will consider other opportunities, particularly earlier-stage scientific deals, he said.