Dean Foods also said it is engaged in "advanced discussions" with the Dairy Farmers of America about selling "substantially" all of its assets. Even if both parties agree to the sale, the transaction would be subject to receiving higher or better offers while the company is in bankruptcy.

Customers are expected to receive their dairy products without any interruptions.

The Dallas-based milk processor said that it plans to use the Chapter 11 proceedings to keep running the business, and address debt and unfunded debt obligations as it seeks to sell the company. Dean Foods has secured commitments for $850 million in debtor-in-possession financing, a type of funding for companies in financial distress.

Dean Foods on Tuesday announced that it has filed for Chapter 11 bankruptcy protection.

Wells Fargo analysts led by John Baumgartner wrote in a note to clients that they see value in the "company-owned refrigerated distribution assets and margin optionality from full-fat dairy products."

In September, Dean Foods said that it had concluded a strategic review and decided against a sale. CEO Eric Beringause joined the company three months ago after serving as chief executive of dairy producer Gehl Foods, which is owned by private equity firm Wind Point Partners.

Dean Foods' business has struggled as more consumers turn to nondairy milk or buy private-label products. Americans' per capita consumption of fluid milk has fallen 26% in the last two decades, according to data from the U.S. Department of Agriculture.

Walmart began processing its own milk in 2017. The retailer's decision sparked upheaval, leading Dean Foods to cancel more than 100 milk contracts with dairy farmers across eight states. Compounding the company's problems, grocery chain Food Lion cut ties with the milk producer in 2018.

In seven of its last eight quarters, Dean Foods has reported a net loss.

The company's bankruptcy filing comes as the country's dairy farmers are also struggling to adapt to the changing milk market. Falling dairy prices, trade turmoil and a labor shortage has hit farmers hard.

"A number of [the National Milk Producers Federation's] member cooperatives provide milk to Dean Foods and could be impacted by today's bankruptcy filing," Alan Bjerga, the senior vice president of communications for the lobbying group, said in a statement to CNBC. "We are gathering information to better assess the situation and will work closely with our members to provide whatever support we are able to through this process."