Borden Dairy filed for bankruptcy Sunday, becoming the second major milk producer in as many months to seek Chapter 11 protection.

Chief executive Tony Sarsam said the company’s debt burden, coupled with industry head winds, left Borden with few options. “This was our final resort,” he told The Washington Post on Monday.

Dean Foods, the nation’s largest milk producer, filed for bankruptcy protection in November. From major corporations to small farmers, milk processors are seeing their margins pinched as wholesale milk costs climb and consumers gravitate to dairy-free options such as almond, soy and oat beverages.

The industry head winds go on from there. Milk producers are up against a decline in cereal sales as consumers shift toward breakfast options with more protein and less sugar. Walmart, the nation’s largest retailer, has started processing some of its own milk, cleaving sales from legacy brands like Borden and Dean, which have had to keep prices low to stay competitive. Americans are even milking goats as never before.

All told, more than 2,700 dairy farms have gone out of business in the past 18 months, Borden noted in its filing.

The 163-year-old company has a storied history. Borden was the first to patent its process for condensing milk and the first to use glass milk bottles. Its mascot, Elsie the cow, is so identified with the brand that Ad Age named it one of the top 10 advertising icons of the 20th century.

Decades ago, Borden looked beyond dairy and went on an acquisition tear; in 1987 alone, it bought 23 companies for $442.6 million, CNN reported. But the buying spree took a financial toll, and Borden was sold to private-equity giant Kohlberg Kravis Roberts for $2 billion in 1995. Many of Borden’s nondairy businesses were eventually sold off.

Headquartered in Dallas, Borden operates 12 milk processing plants and distributes nearly 500 million gallons of milk a year for grocery stores, food service, the hospitality industry and schools. It employs 3,300 people.

In 2018, Borden had $1.2 billion in net sales and losses in excess of $14.6 million. From Jan. 1, 2019, through Dec. 7, Borden reported a net loss of $42.4 million.

Borden said it will continue to operate while it goes through restructuring. It had recently tried to prop up sales with a relaunch of its mascot, Elsie, plus the rollout of other products like a gingerbread eggnog and a milk with higher levels of protein and calcium.

According to the consulting firm Euromonitor, Borden and Dean Foods controlled roughly 13.5 percent of American milk sales last year.

Milk consumption in the United States has dropped 6 percent since 2015. Farmer bankruptcies are on the rise, and farm debt is at record highs, crippling farmers who have struggled to cover essentials such as groceries and electricity.

Still, Sarsam pointed to categories that are seeing an uptick, including whole milk, flavored milk and eggnog. The company has also seen growing popularity with cottage cheese, sour cream and dips.

“Companies that have had similar circumstances have gotten in and out of the filing in about six months,” Sarsam said. “We expect that or faster.”

Dean Foods has said that it sought Chapter 11 protection to meet debt obligations while it looked for a buyer. NBC News reported in mid-November that Dean had secured commitments for $850 million in debtor-in-possession financing, which is for companies under financial strains.