A deal between billionaire Carl Icahn and the casino workers union in Atlantic City fell apart Thursday, but Icahn said he would spend $20 million to keep the bankrupt Trump Taj Mahal open past a looming Saturday closing date.

Icahn made his pledge in a letter posted on Twitter about an hour after union president Bob McDevitt accused Icahn of backing out of the deal. Icahn said he remained hopeful a deal could be reached, and said he would spend up to $20 million to keep the casino open through bankruptcy proceedings.

The fast-moving developments extended an acrimonious three-month standoff that has threatened to close the resort, put 3,000 employees out of work, and turn the Agra-themed casino into the ultimate white elephant on the Boardwalk.

"We thought that we had come to an agreement with all parties," McDevitt, head of Unite Here Local 54, said in a statement around 1 p.m. "We signed it, and the Trump CEO signed as well."

But at noon Thursday, McDevitt said, "we were told that Carl Icahn had gone back on his commitment and would not enter in the agreement."

The collapse of the deal placed a series of Atlantic City fiscal-rescue bills - which contain tax relief for the casinos - on immediate lockdown in Trenton.

And Icahn's chess moves received a sharp rebuke from State Senate President Stephen Sweeney, chief sponsor of the legislation.

"We were ready to move forward today," Sweeney (D., Gloucester) said Thursday evening. "I am honestly heartbroken about what Mr. Icahn is doing down there, and the games he's playing with people's lives."

He said the legislation cannot move forward "when people are taking benefits away from people, or threatening to take benefits and close jobs."

Trump Entertainment Resorts wants to hand over the 24-year-old casino to the 78-year-old Icahn, a self-styled billionaire brawler who took over the Tropicana in 2009, invested millions, and turned it into a profitable casino that attracts bands of partying millennials on weekends and throughout the summer. Icahn owns about $290 million in debt of Trump Entertainment.

Icahn has promised to invest $100 million into the Taj Mahal, provided the state provides sufficient tax relief.

Icahn said he still wants to reach a deal with the state and the union. In his letter, addressed to Trump Entertainment CEO Robert Griffin, Icahn called the company "one of the most distressed companies I have ever come across in my 50+ years of investing."

Icahn said he is continuing to float the casino "even though I have no assurance that the state will provide aid or that the union with drop its appeal."

"Even though I believe that Atlantic City will be great again someday, many people would still argue that it would be a better financial decision for me to let the Taj close," he wrote. "But I cannot be so callous as to let 3,000 hardworking people lose their jobs."

Griffin, who is not expected to stay with an Icahn-owned company, earlier pleaded with Icahn to float the casino for three months on $30 million.

Under the tentative deal - apparently signed, but not delivered - Icahn had caved to the union demands, restoring health and pension benefits he had gone to court to revoke, and giving up on attempts at outsourcing and new work rules, including increased room-cleaning quotas and elimination of paid meal breaks.

In return, Local 54 had said it would withdraw an appeal of the federal bankruptcy court ruling that allowed Icahn and Trump Entertainment to vacate the union contract. The additional money allows that appeal to play out in the courts over two months, and still leaves the union with a vacated contract.

Icahn said he was counting on the package of tax relief that had been scheduled to move through the Legislature on Thursday.

But the viability of the legislation depends on the Taj Mahal's participation, said State Sen. James Whelan (D., Atlantic). The legislation allows the eight remaining casinos, including the Taj, to pay $150 million collectively in taxes for the first two years, and $120 million in the next 13.

"You take out the Taj, it impacts the whole funding formula, and the other casinos would have to pay a larger share to cover," Whelan said.

But the legislation - which the city is also counting on to keep it operational - became a temporary casualty of the Icahn-Local 54 stalemate, kicked to a voting session Jan. 12.

Outside Assembly chambers, a key lobbyist for the casinos paced anxiously and said, "All the casino execs are calling Carl right now, hoping to still make this happen."

The Taj Mahal had been scheduled to close at 5:59 a.m. Saturday, but Icahn's letter and $20 million pledge ended the immediate risk of closure. It would have become the fifth of Atlantic City's 12 casinos to go out of business this year, joining Atlantic Club, Showboat, Trump Plaza, and Revel.

Both Icahn and the union president took shots at the other and the negotiating process.

"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 workers have had to live with and have to endure during this holiday season and beyond."

Icahn, noting for not the first time that he "grew up in one of the roughest neighborhoods in Queens," said he is "in no way 'antiunion.' "

"I respect people who want the opportunity to work hard and better their lot in life," he said in the letter. "It's also the reason why, despite some questionable decision-making from this union's leadership over the last few months, I remain hopeful that I will be able to reach a deal with them."

The Taj Mahal was once the most profitable casino in Atlantic City, and is still considered an attractive convention hotel, with a favorable location across from the newly renovated Steel Pier, whose owners have opened pubs and are planning to build a large observation wheel modeled after the London Eye.

There was no immediate response from the union to Icahn's letter.

The Icahn-Local 54 battle has played out in public in a series of noisy protests by the union and in letters penned by Icahn and Trump executives pleading with the union to meet their request to drop the appeal.

But the tentative deal was brokered by phone at the state level, led by Jon Hanson, Gov. Christie's point man on Atlantic City, and Sweeney.

Griffin has said the bankrupt casino is losing $10 million a month. Icahn also controls the shuttered Trump Plaza, which is expected to be demolished and repurposed into an extension of the Tanger Walk Outlets and the soon-to-open Bass Pro Shops.

Inside the Taj Mahal casino on Thursday, past the porte cochere and white elephant statues with cracked ears and peeling paint, there was a modest amount of gambling going on at the slots, tables, and poker rooms.

"We're all day to day here," said Anthony Mantione, an assistant shift supervisor. "We're all pros at rebounding."

John Blefko of Lancaster played two video poker machines and said his casino hostess was keeping him up to date on the latest news. "It's crazy," he said. "It's unfortunate for the employees - they are getting whipsawed.

"I hope somebody," he said, "saves the day."

arosenberg@phillynews.com

609-823-0453

@amysrosenberg