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

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.

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

Dean Foods also said that it is engaged in “advanced discussions” with 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.

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.

Dean Foods’ business has struggled as more consumers turn to nondairy milk or buy private label products. Consumption of milk has fallen 26 percent in the last two decades.

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 percent in the last two decades, according to data from the U.S. Department of Agriculture.

Walmart began processing its own milk in 2017. Walmart’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 labor shortage have all 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.”