CHICAGO - In a private ceremony attended by a handful of lawmakers, Gov. Pat Quinn signed landmark legislation Thursday to reform Illinois' massively underfunded pension system, though labor unions immediately threatened a lawsuit challenging the new law.

The overhaul, approved by the General Assembly this week after years of delay and inaction, cuts benefits for most employees and retirees. It has a June 1 effective date, but could be delayed by the legal challenges as a coalition of unions said lawyers were directed Thursday to file a lawsuit.

Quinn, who often signs laws with celebratory public events, held a closed-door ceremony at his Chicago office attended by fewer than a dozen people. Among them was House Speaker Michael Madigan, who took credit for brokering the deal in a statement afterward, and House Republican leader Jim Durkin.

The solemn ceremony for the state's most pressing financial issue was a mark of how politically sensitive the issue is in Democrat-controlled Illinois, with hundreds of thousands of public employees and retirees being negatively affected.

"Illinois is moving forward," Quinn said in a statement. "This is a serious solution to address the most dire fiscal challenge of our time."

Illinois' $100 billion shortfall in funding employee retirement benefits is considered the worst pension crisis in the nation. For decades, while other states dealt with similar problems, Illinois lawmakers and governors skipped or shorted payments to their state's five pension systems. The problem has led to repeated downgrades of the state's credit rating.

The new plan is expected to save the state roughly $160 billion over three decades and guarantees Illinois will make its full annual contribution to the pension funds. Legislative leaders have estimated the plan will reduce the current unfunded liability by about $21 billion and fully fund the retirement systems by 2044.

"It's the right thing to do, a long time in coming," Madigan told reporters after the signing. "There's plenty of congratulations that should be spread around to the people that were willing to take a tough vote. ... It's a lot better than bankruptcy."

Quinn didn't deliver formal remarks ahead of the signing, instead talking to attendees individually.

Unions representing public employees say the legislation violates the Illinois Constitution. They cite a provision that prohibits diminishing pension benefits.

The bill gives "working and retired teachers, nurses, police, caregivers, first responders, and others no alternative but to seek justice" through the courts, said a statement from the We Are One Illinois coalition of unions.