Pharmaceutical giant Pfizer announced Monday that it will buy cancer biotech company Medivation for about $14 billion, adding a leading prostate-cancer drug to its oncology offerings.

San Francisco-based Medivation shares were up nearly 20 percent on the news, closing Monday at $80.42 per share.

Pfizer will pay $81.50 a share in cash for Medivation, compared with Sanofi S.A.'s offer in April of $52.50 a share. Since then, Merck, AstraZeneca, Celgene, and Gilead Sciences all reportedly had expressed interest in buying the cancer biotech.

Medivation's drug Xtandi, for advanced metastatic prostate cancer, had $2.2 billion in sales worldwide in the last four quarters, the companies said.

Pfizer, based in New York, has 2,000 employees in Pennsylvania, in Collegeville and at a manufacturing plant in Carlisle.

"The addition of Medivation will strengthen Pfizer's Innovative Health business and accelerate its pathway to a leadership position in oncology, one of our key focus areas," said Ian Read, Pfizer chairman and CEO.

Since 2012, when Xtandi was approved by the Food and Drug Administration, 64,000 U.S. men have been treated with the medicine, which is also being studied to treat non-metastatic prostate cancer and hormone-sensitive prostate cancer, and as a potential treatment for advanced breast cancer and hepatocellular carcinoma, the drugmakers said.

Medivation is developing two other oncology medicines, talazoparib in late-stage patient testing for BRCA-mutated breast cancer, and pidilizumab, an immuno-oncology treatment for B-cell lymphoma and "other hematologic malignancies."

Pfizer's oncology products include Ibrance to treat metastatic breast cancer.

"While Ibrance is doing great, Pfizer could benefit from more critical mass in oncology," pharmaceuticals analyst Timothy Anderson of Sanford C. Bernstein said in a client note Monday.

The deal comes after Pfizer and Ireland-based Allergan P.L.C. called off their $160 billion merger plans in April - two days after the Treasury Department announced tough new rules to thwart U.S. companies' moving their headquarters overseas to lower their taxes.

The new rules make it harder for companies, through a merger, to move their tax addresses out of the United States and then shift profits to low-tax countries, a process called inversion.

After the Allergan deal fell through, Pfizer said it was open to other merger and acquisition prospects.

In May, Pfizer announced it would buy Anacor Pharmaceuticals for $5.2 billion to add an eczema gel to its portfolio.

Medivation will become a wholly owned subsidiary of Pfizer.

Medivation, whose stock closed at $67.16 a share on Friday, closed up 19.74 percent, or $13.26, to $80.42 on Monday.

"Pfizer is the ideal partner to extend the reach of our blockbuster Xtandi franchise and take our promising, late-stage assets - talazoparib and pidilizumab - to their next stages of development," said David Hung, Medivation founder, president and CEO.

Cancer remains the second-leading cause of death in the United States and a "top 10" killer worldwide, the companies said.

Pfizer shares closed down 0.40 percent, or 14 cents, to $34.84 on Monday.