Hostess Brands Inc. agreed in court on Monday to enter private mediation with its lenders and leaders of a striking union to try to avert the liquidation of the maker of Twinkies snack cakes and Wonder Bread.

Hostess, its lenders and the Bakery, Confectionery, Tobacco Workers and Grain Millers International Union (BCTGM), agreed to mediation at the urging of Bankruptcy Judge Robert Drain of the Southern District of New York, who preferred it to the more expensive, public hearing regarding the company's liquidation.

"My desire to do this is prompted primarily by the potential loss of over 18,000 jobs as well as my belief that there is a possibility to resolve this matter," Drain said.

The 82-year-old Hostess is seeking permission to liquidate its business, claiming that its operations had been crippled by a bakers strike and that winding down operations is the best way to preserve its dwindling cash