(Reuters) - French drugmaker Ipsen SA IPN.PA said on Monday it would buy some assets of Merrimack Pharmaceuticals Inc MACK.O, including pancreatic cancer drug Onivyde, for up to $1 billion, barely a month after the U.S. company stopped a breast cancer drug trial.

The deal would give Merrimack the resources to fund the development of three new compounds targeting pancreatic, lung, and other types of cancers. It would boost Ipsen’s portfolio, which has traditionally focused on endocrinology.

Ipsen will pay $575 million at the closing of the deal and up to $450 million more, contingent on some approvals for Onivyde in the United States.

Ipsen would get U.S. commercialization rights for Onivyde and Merrimack's current licensing agreements with Shire Plc SHP.L outside the United States and with PharmaEngine Inc 4162.TWO for Taiwan.

However, Merrimack said it will retain up to $33 million in milestone payments pursuant to its licensing deal with Shire.

The French company would also buy Merrimack’s generic version of ovarian cancer treatment doxorubicin hydrochloride liposome injection, marketed as Doxil, in the United States.

The deal includes Merrimack’s commercial and manufacturing assets, Ipsen said.

Merrimack’s chief executive resigned in October as it embarked on a restructuring, including job cuts to save costs and focus on research and development.

Merrimack said it plans to return at least $200 million to stockholders through a special cash dividend of about $1.54 per common share. It will also return all of the expected $450 million payment to shareholders.

Upon completion of the deal, Merrimack would have about 80 employees, just a fifth of its strength prior to the restructuring initiated in October.

The deal, to be funded by Ipsen’s existing cash and lines of credit, would be dilutive to the drugmaker’s earnings in 2017 but will add to earnings from 2018, the company said.

MTS Health Partners LP and Dechert LLP advised Ipsen on the deal. BofA Merrill Lynch and Credit Suisse Securities (USA) LLC were advisers to Merrimack.

Reuters reported the deal earlier on Sunday, citing people familiar with the matter.