Pfizer Inc. (NYSE:PFE) reports that it has reached an agreement to buy biotech company Medivation Inc. for about $14 billion. According to the terms of the deal, Pfizer will pay $81.50 a share for the company, a 21 percent premium over Medivation’s closing stock price Friday. Pfizer said it plans to finance the transaction with its cash holdings. The deal is expected to close in the third or fourth quarter of 2016.

The announcement of the deal was made on Sunday. Pfizer said the deal would add 5 cents to earnings in the first full year after closing. The deal is subject to customary closing conditions and U.S. antitrust clearance. According to a regulatory filing, Medivation could pay Pfizer a termination fee of $510 million if the deal is derailed before completion.

The deal will increase Pfizer’s presence in the multibillion-dollar market for cancer drugs. Pfizer has been seeking to expand its lineup of such oncology treatments, which includes breast-cancer treatment Ibrance. Pfizer also is interested in developing combinations of cancer agents with immunotherapies, which deploy the immune system in the fight against cancer. Medivation has drugs in development that could complement this goal.

Medivation is one of the few independent biotech companies with a cancer treatment that is already approved and selling well. Medivation is the creator of leading prostate-cancer drug Xtandi. Xtandi generated U.S. net sales of $330.3 million in the second quarter. According to EvaluatePharma, Xtandi could be one of the top-selling cancer drugs by 2020. Pfizer will also get access to Talazoparib, another breast cancer treatment under development.

Cancer is one of the pharmaceutical industry’s biggest markets. World-wide sales of cancer drugs amount to roughly $80 billion a year and grow at a rate of more than 10 percent annually, according to EvaluatePharma. The market is very lucrative for drug makers. These drugs have high prices often surpassing $100,000 a year per patient.

The bidding for San Francisco’s Medivation has been going on for months. French drug company Sanofi made an unsolicited proposal of $52.50 a share in cash for Medivation in April. The company rejected the bid, saying that it undervalued the business substantially. The action pushed the San Francisco-based company to put itself up for sale. A bidding war ensued.

The deal values Medivation at more than double the $6 billion it was valued at earlier in the year. Medivation shares were up 20 percent at $80.56 in premarket trading. Medivation shares were trading as low as $26.41 in February.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.