WORCESTER, Mass. (AP) _ Aaron Feuerstein stayed until the bitter end, surrendering seats at his beloved Tanglewood in order to be present when a federal bankruptcy court judge signed the order making it official: His textile company, Malden Mills, would emerge from bankruptcy.

The signing late Thursday marked the end of two years of negotiations, capped by a marathon, seven-and-a-half hour session where lawyers were still furiously scribbling notes and inserts until the very moment U.S. Bankruptcy Court Judge Joel Rosenthal signed the confirmation just before 9 p.m.

``Mr. Feuerstein, that's for you,'' Rosenthal said, handing the Malden Mills' founder a copy of the order, which takes effect later this month, as the lawyers applauded.

Feuerstein, however, has little time to celebrate. He must raise $93 million by Aug. 26 if he is to buy back a controlling interest in the company once it emerges from bankruptcy protection. At Thursday's hearing, Feurerstein and his lawyer said he may need to ask for more time, and a lawyer for the official committee of unsecured creditors indicated he may not get it.

And assuming he raises the money _ as Feuerstein still insists he will _ he then faces a challenge that would be a handful for someone half his 77 years: making sure Malden Mills, trying to compete in an industry where most of the competition has followed cheaper labor overseas and determined to put people over profits, doesn't fall into bankruptcy a third time.

``I'll be very pleased and happy when the final step comes, which is my exercising the option to regain control of the company, because to my way of thinking that is the only way to secure the employment of our 1,200 employees in Massachusetts,'' he said.

Feuerstein, who gained fame by refusing to lay off workers following a devastating 1995 fire, takes great pride that the company is emerging from bankruptcy at about the same size as it went in. And thanks to military contracts and cost-cutting, it appears to be in much better financial shape, even though revenues are flat.

``I was scared out of my wits that going into the chapter would erode my sales and tarnish my brand,'' he said. ``Today Polartec is probably stronger than it (was) at the time of the bankruptcy and the fire.''

The company did well by the bankruptcy filing. It entered voluntary bankruptcy protection in November 2001 with about $180 million in debt. The plan to emerge for bankruptcy would saddle the new owners with about $65 million, and if Feuerstein exercises his option he would likely have about $100 million, depending on the amount of debt vs. equity in his final financing package.

Operations are in better shape too, though only because cost-cutting has outpaced a revenue decline.

``It is in a far better position today than it was when we first got there,'' said David Orlofsky, who was brought in as interim chief financial officer by Kroll Zolfo Cooper Inc., a turnaround specialty firm. ``It's like night and day.''

Creditors did less well but better than in many bankruptcies, since more than half of Chapter 11 companies never emerge from protection at all. Payments to creditors varied; some unsecured creditors cashed out at 25 cents on the dollar; others who held on will get 18 cents plus stock and some potential other future proceeds, or about 40 cents and some potential proceeds if Feuerstein exercises the option.

``I offered them 100 cents (on the dollar) over time, but they wanted it up front,'' said Feuerstein.

Another party who didn't come out badly was Feuerstein. If he doesn't exercise the option, the agreement calls for him to receive, with his wife, a $425,000 annual salary to serve as president and chairman for up to five years, then $250,000 as a consulting fee for five years after that. Remarkably, his wife or estate would still receive the ``consulting'' fee in the event of Feuerstein's death.

But even if he exercises the option, the future of Malden Mills won't be entirely in Feuerstein's hands. On Thursday, he emphasized that if he regains control the company it will still look for a top-notch chief financial officer and chief operating officer, who could be Feuerstein's successor.

But if Feuerstein's energy is diminished, it wasn't apparent Thursday, when he sat in on some talks among lawyers while occasionally grousing out loud about how long it was taking the lawyers to finish the deal (``Who's paying for them? The bleeding debtor!'' he exclaimed at one point).

And when asked how long he would stay, he said his model was Moses, who lived to be 120, and kept his faculties and vigor until the end.