NEW BRUNSWICK, N.J. — Johnson & Johnson, the world’s largest health care company, has moved to bolster its roster of treatments for rare diseases, announcing a $30 billion deal to acquire Actelion, a Swiss biotechnology firm.

After months of stop-start negotiations — Johnson & Johnson walked away from discussions in mid-December, only for the companies to restart exclusive talks about a deal a few days later — the deal would add Actelion’s treatments for pulmonary arterial hypertension, or high blood pressure in the lungs, to the American giant’s stable.

As part of the deal, Actelion would spin off its drug discovery operations and early-stage clinical development assets into a new Swiss biopharmaceutical company, which would be listed in Switzerland.

“We believe this transaction offers compelling value to both Johnson & Johnson and Actelion shareholders,” Alex Gorsky, the chairman and chief executive of Johnson & Johnson, said in a news release.

The deal allows the company to expand its portfolio with leading medicines and promising late-stage products, he added.

Johnson & Johnson, based in New Brunswick, N.J., said that it would pay $280 a share in cash for Actelion.

Johnson & Johnson would pay for the transaction with cash it holds outside the United States.

The deal was unanimously approved by the boards of both companies and is expected to close by the end of the second quarter.

It is conditioned on Actelion shareholders agreeing to the spinoff and to sell at least 67 percent of their shares to Johnson & Johnson. The acquisition is also subject to regulatory approval.

Johnson & Johnson would initially own 16 percent of the new research and development company, with the right to acquire an additional 16 percent. Actelion shareholders would also receive shares in the new company.

Jean-Paul Clozel, the Actelion chief executive, would serve as the spinoff’s chief executive, and Jean-Pierre Garnier, Actelion’s chairman, would be its chairman.

Lazard, Citigroup and the law firms Cravath, Swaine & Moore; Homburger; and Sexton Riley are advising Johnson & Johnson, while Bank of America Merrill Lynch, Credit Suisse and the law firms Niederer Kraft & Frey; Wachtell, Lipton, Rosen & Katz; and Slaughter and May are advising Actelion.