At the brink of closure, Carl Icahn stepped in to save Atlantic City’s second-biggest casino, the Trump Taj Mahal.

Ready to close its doors, Icahn brokered a deal with the union representing nearly 1,100 casino workers to restore all work rules after not budging on a deal earlier in negotiations, the New York Post reports.

The union got what it wanted, a source told the paper. The deal will save 3,000 jobs in the process.

Icahn had originally been fighting to outsource some services in the casino, including non-union restaurant workers.

The billionaire investor, who owns $292 million in the casino’s bank loans does get a sweetener in the deal. New Jersey state Senate President Stephen Sweeney is expected to propose legislation that will give the Taj Mahal about $150 million in tax breaks, according to the paper.

Sweeney was not going to support the tax breaks unless Icahn reached a deal with the union.

Icahn is expected to turn in his debt along with $100 million in cash for ownership of the casino, a source told the Post.

Trump Entertainment closed down Trump Plaza in September. Icahn is expected to repurpose the casino into a Bass Pro Shops.

Click for more from the New York Post.