TRENTON, N.J. — Billionaire investor Carl Icahn pledged $20 million on Thursday to keep Atlantic City's Taj Mahal casino open indefinitely, eliminating a plan to shut it down Saturday.

In a letter dated Thursday, Icahn promised Trump Entertainment Resorts that he would provide enough money to keep the casino open throughout bankruptcy proceedings. It had been scheduled to close at 6 a.m. Saturday.

"Many people would still argue that it would be a better financial decision for me to let the Taj close and wait to see whether a global settlement can be reached," Icahn wrote to Trump Entertainment CEO Robert Griffin. "But I cannot be so callous as to let 3,000 hardworking people lose their jobs."

His letter came shortly after the main Atlantic City casino workers' union said Icahn told them he was pulling out of a proposed deal on the casino's future operations. Bob McDevitt, president of Local 54 of the Unite-HERE union, said Icahn refused to sign a deal that already had been signed by the union and Trump Entertainment.

"This is what we have been dealing with for some time now at this property," McDevitt said. "We are disappointed that Mr. Icahn's whims are going to add to the feelings of uncertainty and instability that the workers have had to live with and have to endure during this holiday season and beyond."

The union is pressing an appeal of an October bankruptcy court order that terminated health insurance and pension coverage for Taj workers. For months, the company has insisted that the union withdraw the appeal or else it would close the casino. But two threatened shutdown dates came and went, and the latest was less than two days away when Icahn decided to keep the Taj Mahal operating throughout the bankruptcy process.

The deal Icahn declined to sign would have restored contract terms that were in effect before the court-ordered cost-cutting package, including health and pension terms, paid meal breaks, a prohibition on outsourcing of some jobs and a requirement that housekeepers clean fewer rooms per shift.

Icahn said there were numerous reasons for him to walk away from the casino.

"Trump Entertainment Resorts Inc. is one of the most distressed companies I have ever come across in my 50-plus years of investing," he wrote. "The company's hometown of Atlantic City is in the midst of an unprecedented crisis. Intense competition from surrounding markets is steadily eroding gaming revenues for the city's casinos. At the same time, relative to those surrounding markets, the costs of operating a casino in Atlantic City continue to escalate. As a result, four local casinos shuttered in 2014, and a once vibrant Atlantic City institution, your Taj Mahal, loses almost $10 million every month."

The company plans to hand itself over to Icahn, but only if he gets substantial tax breaks. Bills that would have done so were yanked from the state Legislature on Thursday.