BERLIN — German pharmaceutical giant Bayer AG has reached a 5.9 billion euro ($7 billion) deal to sell parts of its Crop Science unit to German chemical company BASF to alleviate regulatory concerns over its planned takeover of U.S. seed and weed-killer company Monsanto Co.

Monsanto last year accepted an offer from Bayer to pay $57 billion to its shareholders and assume $9 billion in debt.

Bayer said Friday it’s working with authorities with the aim of closing the deal by early 2018.

To “address certain overlaps in the combined product portfolio” of the companies, it says it will sell to BASF “essentially all of the company’s field crop seeds businesses,” and the Liberty herbicide brand.

The transaction’s subject to regulatory approvals and the successful closing of the Monsanto acquisition.