Andreas Fuhrmann/The Record Searchlight, via Associated Press

A federal bankruptcy judge on Wednesday approved plans for Hostess Brands to wind down its operations, but there is little doubt that its best-known brand, Twinkies, will live on.

The company, whose corporate ancestors go back 82 years, said it would put Twinkies on the auction block, along with its other famous brands, including Ho Hos, Sno Balls, Ring Dings and Wonder Bread.

In granting the motion by Hostess, Judge Robert D. Drain of the United States Bankruptcy Court for the Southern District of New York said it was important to have a quick and orderly shutdown of the company to prevent the deterioration of its factories and assets.

The company’s chief executive, Gregory F. Rayburn, testified in court that he needed to lay off 15,000 of his 18,500 employees on Wednesday afternoon so that they could begin applying for unemployment benefits as soon as possible. He said such speed was necessary for maximizing the remaining value of the company.

“From this point forward, I need two things to happen,” Mr. Rayburn told the judge. “I need to maximize the value of the estate, and I need to do the best thing for the employees.”

Wednesday’s hearing came after a last-ditch mediation session on Tuesday between Hostess and its bakery workers union. After several hours of talks, the mediation efforts collapsed.

Reuters

Hostess announced its intention to liquidate last Friday, and since then the company has received expressions of interest for its bakery brands from a wide range of potential buyers. Without naming names, an investment banker for Hostess, Joshua S. Scherer of Perella Weinberg Partners, said in court on Wednesday that they included regional bakeries, national competitors and retail customers along the lines of Wal-Mart Stores and Kroger.

Mr. Scherer added that his firm had plans to contact around 145 financial firms, including private equity shops and liquidators, to gauge their interest.

Investment concerns like Sun Capital Partners and C. Dean Metropoulos & Company, the owner of Pabst Blue Ribbon beer, have already said that they are interested in buying some or all of Hostess’s remains. Sun Capital has said that it would like to buy all of Hostess, not just its brands, hoping to preserve the company and improve its often-tense relations with its unions.

Mr. Scherer said that he expected asset sales to reap “significant values,” perhaps more than $1 billion. Hostess had revenue of $2.5 billion in fiscal 2012, and a net loss of $1.1 billion.

Its famous brands have been sold and traded for decades among companies, including I.T.T., Ralston Purina and Continental Baking.

“These products will surely live on in one form or the other — because these brands are about as indestructible as Hostess’s baked goods are,” said Jeffrey A. Sonnenfeld, senior associate dean for executive programs at the Yale School of Management.

Hostess was unable to resuscitate itself during this bankruptcy, its second in less than a decade. When it filed for bankruptcy last January, it had nearly $1 billion in debt as well as labor costs and work rules that it insisted were unsustainable.

According to Mr. Rayburn, what sent the company into bankruptcy was both the refusal of one of its largest unions, the Bakery, Confectionery, Tobacco Workers and Grain Millers International Union, to accept far-reaching concessions and a strike that the union began on Nov. 9, crippling two-thirds of the company’s 33 bakeries.

The bakery workers union, with 5,600 workers at Hostess, repeatedly said that it saw no reason to grant a new round of givebacks — after having granted major concessions in the previous bankruptcy of Hostess — because it was convinced that Hostess was heading toward liquidation, with or without concessions. That union and Hostess’s other major union, the Teamsters, repeatedly asserted that the company was mismanaged, having had six different chief executives since 2002. The unions maintained that Hostess’s top management had done little to modernize the company’s aging bakeries or its sugary product offerings — in an era when the nation has grown increasingly health conscious.

After filing for bankruptcy protection in January, Hostess demanded lower-cost contracts from the Teamsters, whose workers at Hostess average about $20 an hour, and the bakery workers, who average about $16. To help the company survive, the Teamsters, with 6,700 members at Hostess, most of them drivers, reluctantly agreed to a contract with numerous concessions. They include new work rules, an immediate 8 percent pay cut, a 17 percent reduction in Hostess’s contribution toward health coverage and a suspension of its pension payments until 2015. In return, the company agreed to give its unions two of the nine seats on its board and a 25 percent stake in the company.

But the bakery workers’ union resisted a similar deal, convinced it would drive down wages in the industry while in no way guaranteeing Hostess’s survival. That union went on strike rather than accept that offer, hoping the company would bend.

A week after the strike began, Mr. Rayburn said he would liquidate the company.

The looming liquidation of Hostess has been a topic of debate, with many on one side criticizing greedy, stubborn labor unions and many on the other blaming what the bakery workers’ president has called “vulture capitalists.” The company entered its first bankruptcy in 2004 with $450 million in debt, and exited five years later with even more debt — $670 million.

“The private equity owners put this thing in such deep debt and asked for such deep concessions that it put the unions in a difficult situation,” said Thomas A. Kochan, a professor at the Sloan School of Management at the Massachusetts Institute of Technology. “The unions weren’t sure whether these concessions would be enough to salvage the company.”

Hostess Brands has corporate roots going back to 1930, but the company has had that name only since 2009, when Ripplewood Holdings, the private equity firm that took control of Interstate Bakeries, renamed it. Ripplewood, which has close ties to Richard A. Gephardt, a former Democratic House majority leader and longtime ally of labor unions, is rarely viewed as a predatory private equity company — it originally bought Hostess as part of an effort to save distressed unionized companies.

“The company had plenty of time to figure out a new business model in terms of products, but it didn’t, so it was convenient to blame labor for the company’s failure,” said John W. Budd, a professor of industrial relations at the Carlson School of Management at the University of Minnesota. “Hostess’s creditors weren’t willing to make any more concessions, so if they didn’t see a viable business model, that raises questions of why labor should be making more concessions.”