WHITE PLAINS, N.Y. — A federal bankruptcy judge on Wednesday approved Hostess Brands’ request to close 33 bakeries and put such well-known brands as Twinkies and Wonder Bread up for sale.

Among the 18,500 workers nationally to lose their jobs are 500 in Maine, 370 of them at the company’s bakery in Biddeford, which produced chocolate cupcakes, Sno Balls and other cakes and bread.

Hostess said it plans to retain about 3,200 employees to help with the initial phase of the wind down. The entire process should take about a year.

After a day of mediation between Hostess and its second-largest union failed Tuesday, Judge Robert Drain of the Southern District of New York approved the liquidation, citing the company’s need for a quick closure to avoid letting the assets sit idle for too long, The Associated Press reported.

“This estate will suffer substantial diminution if this wind-down plan is not quickly implemented,” Drain said.

Hostess, which had filed for its second bankrutpcy in January, stopped production on Nov. 16 after a one-week strike by its bakery workers.

“It’s hard not to think about this from the view of the workers, who have fears about the future, especially around the holidays. The grinch has come back in the form of a corporation,” said Biddeford Mayor Alan Casavant.

“I wanted to acknowledge the tragedy that’s taking place here,” Richard Seltzer, a lawyer for Hostess’ largest union, the Teamsters, said in court Wednesday.

The bakers union did not immediately return calls Wednesday afternoon seeking comment.

At Wednesday’s hearing, Hostess got approval to return excess ingredients and packaging, and pay $4.36 million in retention bonuses for rank-and-file employees who will work over the next several months to mothball equipment and close the company. Hostess also said its lenders agreed to allow it to distribute an extra day’s pay to its employees, which will total $1 million, The Associated Press reported.

Hostess also is seeking bankruptcy court approval to pay $1.75 million in bonuses to 19 managers. The bonuses range from $7,400 to $130,500. Hostess officials said Wednesday they would return to court at a later date to discuss the bonuses.

“Obviously, this is a very difficult and disappointing time for workers in Biddeford and around the country,” said Matt Schlobohm, executive director of the Maine AFL-CIO. “The challenge now is to move as quickly as possible to find a responsible buyer that’s interested in making bread and cakes, rather than the Wall Street model we’ve had at Hostess for years, which was focused on the enrichment of management.”

The judge’s decision marks the formal end of Hostess Brands, which suffered a decade of financial problems, management turnover and declining demand. Workers claimed that the company, owned by private equity firm Ripplewood Holdings and several hedge funds that include Silver Point Capital, failed to invest in new technology, marketing and improvement of factories and trucks, The Associated Press reported.

John Bubier, city manager of Biddeford, said the bankruptcy judge was wise to move quickly on a decision about Hostess’ closure so the factories and machinery won’t age and the brands won’t lose too much shelf space and market share.

“In the long run, it would have been better if Hostess had been able to move on and reach an agreement with workers. Absent that, it’s a question of whether someone somewhere is interested and able to buy the assets. The sooner that someone buys it, the better,” Bubier said.

Hostess fired more than 15,000 workers immediately so they could begin getting unemployment benefits.

Hostess lawyer Heather Lennox told the bankruptcy court that the company had received “a flood of inquiries” in recent days from potential buyers, The Associated Press reported.

“We therefore think there could be very healthy competition,” Lennox said, adding that Hostess may seek court approval to take specific assets to the auction block within the next several weeks.

Joshua Scherer of investment bank Perella Weinberg Partners LP, which is advising Hostess, said Hostess has received more than two dozen unsolicited calls over the past several days alone from interested buyers.

“These are name-brand companies that everyone in this courtroom would know and recognize,” Scherer said. “This is a once-in-a-lifetime opportunity for our competitors … to get iconic brands separated from the legacy liabilities.”

Scherer said his firm plans to contact about 145 financial firms, including private equity shops and liquidators, to gauge their interest. Investors such as Sun Capital Partners and C. Dean Metropoulos & Co., owner of Pabst Blue Ribbon beer, have already said that they are interested in buying some or all of Hostess’ assets.

Staff Writer Jessica Hall can be contacted at 791-6316 or at:

jhall@mainetoday.com