“The General Assembly may find itself in crisis, but it is a crisis which other public pension systems managed to avoid,” Justice Karmeier wrote. He added later, “It is a crisis for which the General Assembly itself is largely responsible.”

Labor officials lauded the decision. “We are thankful that the Supreme Court has unanimously upheld the will of the people, overturned this unfair and unconstitutional law, and protected the hard-earned life savings of teachers, police, firefighters, nurses, caregivers and other public service workers and retirees,” Michael T. Carrigan, the president of the Illinois A.F.L.-C.I.O., said.

Yet the ruling left the state’s fiscal future in doubt, and lawmakers themselves expressed uncertainty about the challenge ahead: how to solve a gaping pension deficit without taking away any benefits. The political environment, too, has grown more complex since Mr. Quinn was replaced this year by Bruce Rauner, the state’s first Republican governor in more than a decade.

After speaking to businesspeople here on Friday, Mr. Rauner said he had expected the pension changes to be overturned and had disagreed with how they changed retirees’ benefits. He said he believed that voters should consider a constitutional amendment that would mark a distinction between guarantees of benefits already earned and changes to future benefits. As it is, under the state’s Constitution, officials may assign new benefits to future workers, but cannot diminish benefits already promised.

“Rather than spend years in court, we’d rather do a constitutional referendum and try to clarify that benefits earned should be protected, but the future is unknown and it can be higher or lower,” Mr. Rauner said.

During his speech, Mr. Rauner issued a grave assessment of the state’s fiscal health, as he has in appearances around the state in recent weeks. “If Illinois was a corporation, it would probably need to file for bankruptcy,” he said. Still, Mr. Rauner said he has been in talks with legislative leaders and hoped to have a budget deal and a new pension solution in place by the end of the month.

Lawmakers sounded far less certain. A spokesman for Michael J. Madigan, the speaker of the State House, said he was reviewing the decision. John J. Cullerton, the Senate president, said he had long been concerned about the constitutionality of what lawmakers passed in 2013 and that he viewed the ruling as a victory for retirees, public workers and “everyone who respects the plain language” of the state Constitution.