Campaign worker Nate Neuenschwander, left, watches election returns at a campaign party for people voting "No" on Measure B, which supported the state in attempting to cut pensions of public workers, in San Jose, Calif., on June 5, 2012. Paul Sakuma/AP

A state court judge has barred the city of San Jose, Calif., from imposing voter-approved pension cuts on current municipal workers in a ruling with implications for cash-strapped local governments across California, and perhaps the United States.

As public employee unions and many U.S. cities lock horns over retirement costs blamed for municipal budget crises, Superior Court Judge Patricia Lucas ruled that a ballot initiative forcing workers to contribute more to their pensions was invalid.

In her ruling, dated from last week but publicly released Monday, Lucas said the city was entitled under the ballot measure to cut workers' pay to save money, but she held that vested pension benefits were protected by state law and thus off limits.

The court fight in San Jose over pensions has been closely watched because other cities in California, and across the country, are targeting cuts in existing retirement plans as a way to reduce budget deficits.

The emergency manager appointed to oversee the finances of bankrupt Detroit has said he wants to slash pension costs there, a move already under challenge by public employee unions in that city.

Illinois is also battling public unions in an attempt to cut pensions.

San Jose Mayor Chuck Reed, a Democrat, encouraged voters in his city to back municipal pension cuts he proposed as part of last year's Measure B, which drew 70 percent support at the polls.

It called for city workers, including police, firefighters and other employees, to contribute up to 16 percent more toward their pensions.

The unions challenged the measure, leading to Judge Lucas' ruling in Santa Clara County Superior Court. Her decision is likely to be appealed.

Reed also is pressing for a statewide ballot initiative next year that would give cities across California the authority to reduce pension benefits.

In a statement, Reed welcomed the judge's ruling on pay cuts, but added: "Unfortunately, the judge's decision to invalidate certain portions of Measure B also highlights the fact that current California law provides cities, counties and other government agencies with very little flexibility in controlling their retirement costs."

Those with city pensions were singing a different tune.

"We're happy about the ruling," said Sergeant Jim Unland of the San Jose Police Officers' Association. "We've been saying for two years that cutting pensions was illegal, and now we have a judge saying that."

Al Jazeera and Reuters