A container of Dean Foods Co. Dairy Pure brand sour cream is displayed for a photograph in Dobbs Ferry, New York, U.S., on Wednesday, Feb. 20, 2019.

Dairy Farmers of America announced Monday that it has agreed to buy Dean Foods, America's largest milk producer, for $425 million.

The dairy co-operative will also assume Dean's liabilities as part of the deal to acquire 44 of the company's facilities, as well as other assets.

Dean filed for Chapter 11 bankruptcy in November as the business struggled to attract consumers who have instead turned to nondairy milk or private-label products. At the time it filed for bankruptcy, Dean had reported a net loss in seven of its last eight quarters.

"We have had a relationship with DFA over the past 20 years, and we are confident in their ability to succeed in the current market and serve our customers with the same commitment to quality and service they have come to expect," Dean Foods CEO Eric Beringause said in a statement.

If approved by the bankruptcy court, the agreement would make the Dairy Farmers of America the stalking horse bidder, meaning that the transaction would be subject to receiving higher or better offers while the company is in bankruptcy. The company is also talking with other buyers interested in plants and assets not included in the deal with the co-op.

The deal would also need approval from the Department of Justice, which has reportedly begun probing the merger, according to the Wall Street Journal.