The Department of Justice has approved a multi-billion dollar merger between Bayer and Monsanto that will create one of the world's largest agrichemical companies.

The merged company will have to divest approximately $9 billion in businesses and assets as part of the deal.

It's the "the largest divestiture ever required by the United States in a merger enforcement proceeding," said Antitrust Division Chief Makan Delrahim.

Bayer, which offered $66 billion for Monsanto, will sell its divested assets and companies to BASF (BASFY), a chemical and crop protection company. Bayer had previously announced that it reached a deal with BASF.

Bayer and Monsanto have agreed to the government's divestiture terms, according to Delrahim. The merger will now undergo a 60-day public comment period, after which a judge is expected to sign off on the deal including the government's conditions.

Bayer (BAYRY)will divest its entire seed business, including cotton, canola, soybean and vegetable seeds, and also its herbicide assets including the Liberty brand, which is a competitor to Monsanto's Roundup.

The DOJ also requires the divestiture of intellectual property, including R&D projects, and Bayer's "digital agriculture" business to develop new farm technologies to maximize crop yield.

"Receipt of the DOJ's approval brings us close to our goal of creating a leading company in agriculture," said Bayer CEO Werner Baumann, in a statement.

Related: Bayer and Monsanto unveil $66 billion merger agreement

The German company Bayer and Monsanto (MON), an agricultural company based in St. Louis, first announced their merger agreement in 2016. The DOJ's antitrust division has been investigating the merger on concerns that it would drive up seed prices, which would impact farmers as well as consumers.

Bayer, which is strongest in Asia and Europe, stands to gain from Monsanto's expertise in agriculture and seeds. It would also benefit from the U.S. company's big presence in North America.

Bayer has said combining the companies would generate synergies of $1.5 billion over three years.

But Bayer is buying Monsanto at a desperate time for American farmers. US farm profit fell to $61 billion in 2016, the lowest since 2006, and less than half the income farms earned in 2013, according to the USDA.

The deal is the latest mega-merger aimed at reshaping the agribusiness and chemical sectors.

A spokeswoman for BASF called the DOJ approval an "important milestone" in the merger process. Monsanto did not immediately return messages from CNNMoney.

CNN's Jethro Mullen and Charles Riley contributed.