A Cook County judge on Friday threw out a 2014 law aimed at reducing multibillion-dollar shortfalls in two Chicago pension funds, a decision city officials have said could leave the retirement accounts insolvent in a little more than a decade or lead to massive tax increases.

Judge Rita Novak wrote that the changes to pensions for some 61,000 current and retired municipal employees and laborers are unconstitutional. She also said workers and retirees who have been paying more into their retirement funds or have been receiving less in benefits since the law took effect on Jan. 1 are entitled to recoup their losses.

Union leaders and former city workers who gathered outside the courtroom declared it a win for retirees and workers who have consistently made their contributions to the retirement accounts, even when the city for years did not.

"We were promised something," said Charles Lomanto, who worked for the city's streets and sanitation department for 28 years. "We signed a contract."

Stephen Patton, Chicago's corporation counsel, said the city plans to appeal.

"While we are disappointed by the trial court's ruling, we have always recognized that this matter will ultimately be resolved by the Illinois Supreme Court," he said in an emailed statement. "We now look forward to having our arguments heard there."

Chicago has the worst-funded pension systems of any major U.S. city, with a roughly $20 billion shortfall in its four accounts and another approximately $7 billion debt in the fund for teachers.

The 2014 overhaul sought to eliminate a $9.4 billion unfunded pension liability in two of the funds by cutting benefits and increasing contributions.

Workers, retirees and labor unions sued, saying the Illinois Constitution protects retirement benefits. Novak agreed, citing an Illinois Supreme Court ruling earlier this year that said similar changes to state pension funds were unconstitutional.

Chicago officials argue that the city's pension overhaul varies from the state's because it "preserves and protects" the funds.

Mayor Rahm Emanuel has said without the overhaul pension funds will become insolvent by 2026 and 2029. City officials also have said residents will likely see huge tax increases as Chicago is forced to make much larger payments to the funds -- an increase of $900 million per year, or about $2.48 million each day.

Emanuel, who must get approval from the Illinois Legislature and Republican Gov. Bruce Rauner for any pension changes, still must address shortfalls in the city's police and fire and teacher pension funds.

Union leaders said Friday they are willing to sit down with the mayor to negotiate another solution, but said it shouldn't include cuts to what they call "modest" pension benefits. Anders Lindall, spokesman for the American Federation of State, County and Municipal Employees Council 31, said the typical beneficiary receives a pension of about $32,000, and doesn't receive Social Security benefits.

He suggested the city could look at closing corporate tax loopholes, ending tax-increment financing districts that divert property tax revenue from the city, and consider "other creative ideas to ask rich folks to pay their fair share."

"The problem with pensions is a funding problem, it's not a benefit problem," Lindall said.