Pfizer, the world's largest drugmaker, plans to divest its off-patent drug business and combine it with generic-drug maker Mylan.

Under the agreement, which is structured as an all-stock deal, each Mylan share would be converted into one share of the new company.

Pfizer shareholders would own 57% of the combined new company and Mylan shareholders would own 43%, Mylan said. The Wall Street Journal first reported the news.

The combined company, which will sell Mylan's EpiPen and Pfizer's Viagra, will be domiciled in the U.S. The deal will be structured in what's known as a reverse Morris trust, with Pfizer's Upjohn business divested and then combined with Mylan.

Mylan shares jumped 20% to $22.10, while Pfizer shares slipped nearly 2% to $42.34 in early trading on Monday.

The combined company could draw annual sales of more than $20 billion. Mylan reported 2018 sales of $11.4 billion and while Pfizer hasn't broken out full-year numbers for its China-based Upjohn unit, its first-quarter sales were just over $3 billion. Pfizer's total 2018 revenue was $53.6 billion.

Mylan's stock is down 76% from its 2015 high amid scrutiny of its price increases on the EpiPen, pressure on U.S. generic drug prices and an investigation into drug-price collusion in the industry. The deal is the "best-case outcome" for Mylan, said Jared Holz, health-care strategist at Jefferies. Mylan said last year it had formed a strategic review committee to evaluate options for the future of the company.

Pfizer investors are more mixed on the deal, according to Holz, who said he's received feedback from shareholders since the Journal's first report Saturday morning.

It would mark a further move under new Chief Executive Albert Bourla to streamline Pfizer's focus on branded medicines and vaccines. The company agreed in December to combine its consumer-health business, which sells Advil and other brands, with GlaxoSmithKline's in a joint venture of which GSK has a majority controlling interest. In June, Pfizer said it would spend $11.4 billion to acquire the cancer-drug maker Array BioPharma.

The Mylan deal, Holz said, could be "dilutive to earnings over the near term because of how profitable Upjohn is to Pfizer."

The new company will be led by Pfizer's Michael Goettler, currently president of the Upjohn business. Mylan Chairman Robert Coury will be executive chairman, and Mylan CEO Heather Bresch will depart.

Holz called the management shuffle a positive for the deal, noting Mylan's had "one of the most out-of-favor management teams in all of health care."

Bresch was at the center of the 2016 uproar over Mylan's pricing of the EpiPen, a lifesaving medication delivery system for people with extreme allergies. The price of a pair of EpiPens had risen to $600 from $100 in 2008, and she defended the price hike. Mylan later offered a generic version for about $300.

As part of the deal, Pfizer will separate its Upjohn unit in a tax-free spinoff and will simultaneously combine with Mylan.

Upjohn will issue $12 billion of debt at or prior to separation. After the deal closes, the new company will have about $24.5 billion of total debt outstanding.

Separately, Pfizer on Monday reported a 30% rise in quarterly profit, helped by demand for its branded treatments such as Ibrance, Eliquis and Xeljanz.

Centerview Partners and PJT Partners are Mylan's financial advisors, while Cravath, Swaine & Moore and NautaDutilh are providing legal counsel. Pfizer's financial advisors are Goldman Sachs and Guggenheim Securities, while its legal advisors are Wachtell, Lipton, Rosen & Katz and De Brauw Blackstone Westbroek. Davis Polk and Wardwell is Pfizer's special tax counsel.

—Reuters contributed to this article.