Spencer Platt/Getty Images

A federal bankruptcy judge on Thursday approved Edward S. Lampert’s plan to buy Sears, but the judge implored Mr. Lampert to make a fresh start.

Mr. Lampert, a billionaire hedge fund manager, could avoid becoming the “cartoon character” his critics have painted him as, Judge Robert Drain said — a cross between Jay Gould, the Gilded Age robber baron, and Barney Fife, the blustery gullible sheriff on the “Andy Griffith” show.

Rather, Judge Drain said, Mr. Lampert could “take action that would in fact be of great meaning” to the company’s constituents, particularly its workers.

The remarks capped an all-day hearing on the fate of Sears, which filed for bankruptcy in October.

At stake was whether Sears, a company founded shortly after the Civil War, would shut its doors or continue operating with less debt and a sound turnaround strategy.

But the hearing was also a referendum on Mr. Lampert, the company’s chief executive and largest shareholder who has controlled Sears since 2005.

Many of the company’s creditors accused Mr. Lampert and his hedge fund, ESL Investments, of running Sears into the ground, racking up losses and falling behind competitors, while…