SACRAMENTO, Calif. (AP) — Striking at the sanctity of public pensions in California, a federal judge ruled Wednesday that U.S. bankruptcy law allows the city of Stockton to treat pension fund obligations like other debts, meaning the city could trim benefits.

Stockton argued that it must make its pension contributions for public employees before its creditors are paid the entire amount they are owned.

The case is being closely watched because it could help clarify who gets paid first by financially strapped cities around the nation — retirement funds or creditors.

The ruling was prompted by a key creditor's contention that pension obligations should be treated like other debts. Franklin Templeton Investments said the pension payments are fair game as it tries to collect on an unsecured $32.5 million claim against the city.

U.S. Bankruptcy Judge Christopher Klein said he would announce his decision on Oct. 30 on the city's overall plan to leave bankruptcy and the contention by Franklin Templeton.

California pension officials said they expect his decision Wednesday on the pension plans to be appealed.

Attorneys had argued that California law gave pension funds special protections beyond those offered in other cases such as the bankruptcy declaration in Detroit.

In making his ruling Wednesday, Klein said, "California public employee retirement law ... is simply invalid in the face of the supremacy clause of the United States Constitution."

That means federal bankruptcy and contract law applies to the pension fund, "just like anybody else," Klein said.

Stockton bankruptcy attorney Marc Levinson said employees of Stockton could be forced to take a 60 percent pension "haircut" if the judge rejects its overall reorganization plan.

That plan calls for continuing full payments to the giant California Public Employees' Retirement System. If the plan is approved by Klein, his ruling on treating pension payments like other debts would have no practical effect, CalPERS attorney Michael Gearin told reporters.

Stockton can afford to pay Franklin Templeton in full over 30 years even if it also keeps making its pension payments, Franklin Templeton Investments attorney James Johnston told Klein.

The judge spent much of the morning questioning whether CalPERS and its members enjoy a protected status under federal and state laws.

"One can't mess with CalPERS, that's the vernacular way of putting it," the judge said at one point, summarizing the view of CalPERS and Stockton officials.

"Is CalPERS a state unto itself?" Klein mused later.

Stockton, an inland port city, became the largest city in the country in 2012 to file for Chapter 9 protection before Detroit made the move last year.

City manager Kurt Wilson said after the hearing that another month's delay in a final ruling on the city's future won't matter as Stockton fights for revival.

"As long as we get to the right place, then a little inconvenience won't hurt," he said.

Before the recession, Stockton leaders spent millions of dollars revitalizing the downtown area with a new City Hall and building a marina, sports arena and ballpark. The city issued about 3,000 permits annually to build new homes, and it paid police premium wages and health benefits.

With the recession, building dried up, and Stockton became ground zero for home foreclosures. Like many residents, City Hall couldn't pay its bills. The city slashed its budget by millions of dollars and laid off 25 percent of its police officers. Crime soared.

The city about 80 miles east of San Francisco wants Judge Klein to approve its plan for reorganizing more than $900 million in long-term debt. Franklin Templeton Investments wants the judge to reject the proposal.

The city has reached deals with all of its major creditors, except for Franklin.

"It takes two to tango," said Levinson, the city's bankruptcy attorney. "We were unable to reach a deal."

Franklin attorney Johnston said the company is being offered 1 cent on each dollar for a loan given to Stockton in 2009 to build firehouses and parks, and to move its police dispatch center.

Johnston told the judge that Stockton struck much more favorable deals with other creditors.