NEW YORK (AP) -- A bankruptcy judge has approved the sale of Twinkies to a pair of investment firms, one of which has said it hopes to have the cakes back on shelves by summer.

Hostess Brands is selling Twinkies, along with Ding Dongs, Ho Hos, and other cakes, to Apollo Global Management and Metropoulos & Co. for $410 million. Evan Metropoulos, a principal of the latter firm, said in an interview that he wants to have Twinkies back on shelves by June and that the brands could benefit from product extensions, such as different flavors.

Apollo's investments include the fast-food chains Carl's Jr. and Hardee's. Metropoulos owns Pabst beer.

Judge Robert Drain of the U.S. Bankruptcy Court of the Southern District of New York also approved the sale of Wonder bread to Flowers Foods (FLO 0.69%), which makes Tastykakes and other breads. Flowers, based in Thomasville, Ga., will also get Nature's Pride, Butternut, Home Pride, and Merita as part of the $360 deal.

The sale of Beefsteak, a regional bread brand, to Grupo Bimbo for $31.9 million was also approved.

A separate hearing is scheduled for April 9 to approve the sale of Drake's cakes, which include Devil Dogs and Yodels. Hostess picked McKee Foods, the maker of Little Debbie snack cakes, as the buyer for those brands at $27.5 million.

Taken together, a Hostess spokesman said 29 of the bankrupt company's 36 bakeries were sold as part of the transactions. It will be up to the new owners whether to hire back the thousands of workers who lost their jobs when the company went out of business.

In a statement, the company's bakers union said it shared the enthusiasm exhibited by the new ownership to bring Hostess brands back to shelves quickly.

The Bakery, Confectionery, Tobacco Workers, and Grain Millers International Union said it believed "our highly motivated and skilled workforce will serve as indispensable partners in the seamless reopening of factories."

Hostess shuttered its factories in late November following a strike by the union. The company had been struggling financially for years.