Trump Entertainment Resorts Inc.'s Taj Mahal in Atlantic City will survive as part of billionaire Carl Icahn's empire under a bankruptcy restructuring plan approved by a federal judge Thursday.

Trump Entertainment, which also owns the shuttered Trump Plaza, adds to Icahn's gaming venues in the downtrodden seaside town, joining the Tropicana, which the investor acquired out of bankruptcy five years ago.

"The Taj will remain open," U.S. Bankruptcy Judge Kevin Gross said at a hearing in Wilmington. "And it will be a successful venture."

The decision brings a close to a bankruptcy in which Trump Entertainment found itself on the brink of liquidation multiple times. The company had threatened to close the Taj over disputes with its union.

Trump Entertainment filed for bankruptcy Sept. 9 and shut the Plaza days later. It was one of four Atlantic City casinos that closed last year.

Lenders controlled by Icahn provided Trump Entertainment $20 million in bankruptcy financing to help fund operations until the turnaround plan takes effect.

Under the plan, the Icahn lender group gets control of both casinos by converting about $292 million of debt into equity in the reorganized company. The Icahn group will also provide $13.5 million to fund the Taj after it exits court protection.

The casino owner was able to eliminate most opposition to the plan, striking a deal with unsecured creditors last month and with Donald Trump on Monday.

But the plan hinges on an appeals court's rejecting a union's challenge to the judge's decision last year to terminate an expired contract, allowing the company to shed pension and health-care obligations.

This article contains information from the Associated Press.