It's official: A hedge fund helmed by Sears' controversial ex-CEO has closed the deal to buy the beleaguered company for $5.2 billion.

A federal bankruptcy judge approved the purchase by Eddie Lampert's ESL Investments last week, giving the green light for the bankrupt retailer, which also owns Kmart, to avoid liquidation and begin a second act.

The new company will be significantly smaller with 223 Sears and 202 Kmart stores. But it will be trying to thrive in the same competitive environment that hobbled it before, leading it to shutter more than 3,500 locations, and slash roughly 250,000 jobs amid tumbling sales.

Lampert said in a statement that the new Sears is up to the challenge.

The best possible outcome has now been realized for all stakeholders,'' Lampert said. "ESL looks forward to a new era at Sears and Kmart that builds on their proud histories, while finding new ways to innovate and grow to adapt to the forces transforming the retail industry.''

The new business will be under ESL's affiliate, Transform Holdco, and ESL said that the same warranties and other programs for shoppers will continue.