Hostess Brands Inc., Irving, Texas, must return to a “liquidation scenario” after mediation with the Bakery, Confectionery, Tobacco and Grain Millers International Union (BCTGM) failed to prevent a shutdown that may eliminate more than 18,000 jobs, the judge overseeing the company’s bankruptcy said today.

Hostess Brands’ CEO Gregory Rayburn told U.S. Bankruptcy Judge Robert Drain that 15,000 Hostess workers will be fired today to allow them to start collecting unemployment benefits. The company is seeking Drain’s permission to close, so it can begin selling its assets.

Most of the wind down would take place in the first three months, a Hostess lawyer said. The initial focus would be on “selling assets to continue as a going concern,” followed by an open auction.

Rayburn also asked Drain to shield company officials from lawsuits over today’s planned firings. Hostess has said more than 3,000 employees will stay on temporarily to clean plants and maintain equipment.

Drain adjourned the hearing two days ago and sent the parties off for a last-ditch effort to negotiate terms that might keep the company afloat.

Hostess and the union agreed to Drain’s request to enter confidential mediation under his supervision. Company and union officials acted in good faith in yesterday’s talks at the law offices of Jones Day in New York, according to Drain.

“Unfortunately, the last-minute mediation efforts by Judge Drain were not successful,” Ken Hall, general secretary-treasurer of the Teamsters union that represents Hostess drivers, said in a statement. “This is a tragic outcome.”

Hostess is asking the judge for approval to shut down 36 bakeries, 242 depots, 216 retail stores and 311 hybrid depot-store facilities, according to court filings. There are also 58 other leased or owned sites used for storage, product warehousing or parking.