Almost four years after seeking bankruptcy protection under a barrage of labor issues and rapidly changing appetites, the maker of Twinkies and Ding Dongs will take the stage once again as a publicly traded company.

Hostess Brands, which first emerged in 1919 with the Hostess CupCake, has been shuffled between different owners since it sought Chapter 11 bankruptcy protection for a second time in July 2012.

The latest owners, the Apollo Global Management and Metropoulos & Co., will sell the majority of the company, valued at about $2.3 billion. The new owners, Gores Holdings, an acquisition company run by the private equity firm Gores Group, will put up $375 million in cash, the companies said Tuesday.

Metropoulos, who has helped to lead the bakery, will continue to do so as executive chairman. William Toler will remain as Hostess CEO.

Apollo and Metropoulos will hold a 42% combined stake when the deal is completed — at some point, it is hoped, during the third quarter.

Hostess has cut costs and increased automation. Last year, the company announced plans to shut the suburban Chicago bakery where the Twinkie was invented, and 400 jobs evaporated.

Hostess is based in Kansas City, Mo. It operates baking facilities in Emporia, Kan.; Indianapolis; and Columbus, Ga.

Many feared that Twinkies, which debuted in the 1930s and became a staple in school lunchboxes, was a fading piece of Americana.

After the company asked a bankruptcy judge for permission to go out of business in 2012, enthusiasts flocked to stores in search of what they believed would be the last remaining Twinkies and Ding Dongs. The snack cakes also showed up on online auction sites at inflated prices.

A year later, the treats returned to store shelves after Hostess’ brands were sold off.

The credit rating for Hostess has been on the mend, and last year the company posted revenue of about $650 million.

Times staff writer Samantha Masunaga contributed to this report.

UPDATES:

8:04 a.m.: This story has been updated to include information about people rushing to buy Hostess snacks in 2012.