By Tim Reid

(Reuters) - Less than two years after exiting bankruptcy, the city of Vallejo, California, is again facing a budget crisis as soaring pension costs, which were left untouched in the bankruptcy reorganization, eat up an ever-growing share of tax revenues.

Vallejo's plight, so soon after bankruptcy, is an object lesson for three U.S. cities going through that process today - Detroit, Stockton and San Bernardino, California - because it shows the importance of dealing with pension obligations as part of a financial restructuring, experts say.

The Vallejo experience may be particularly relevant to Stockton, which is further along in its bankruptcy case than Detroit and San Bernardino and has signaled its intention to leave pension payments intact.

All three current bankruptcies are considered test cases in the titanic battle between Wall Street and public pension funds over whether municipal bondholders or current and retired employees should absorb most of the pain when a state or local government goes broke.

"Any municipal bankruptcy that doesn't restructure pension obligations is going to be a failure because pension obligations are the largest debt a city has," said Karol Denniston, a municipal bankruptcy attorney in San Francisco.

"A city like Vallejo can be reasonably managed but it is still going to be flooded out because it cannot be expected to keep up with its pension obligations."

Calpers, the retirement system for California public employees, said it had "reached out" to Vallejo to discuss concerns. "Employers looking to cut costs have some options that can make benefits easier to manage in the near term, some of which Vallejo has already taken," Calpers said in a statement. "We are pleased Vallejo has remained committed to delivering on the pension promises it made to its employees."

Calpers is the largest pension system in the United States and serves many California cities and counties. It has long argued that it has a much wider responsibility than managing pensions for individual cities. It says state law mandates that it is the custodian of the entire fund, and as such is unable to renegotiate pension rates that cities have agreed to with their workers.

Vallejo, a port city of 115,000 near San Francisco that was staggered by the closure of a local naval base and the housing market meltdown, filed for Chapter 9 bankruptcy protection in 2008 with an $18 million deficit.

During its three-and-half year bankruptcy, the city slashed costs, including police and firefighter numbers, retiree health benefits, payments to bondholders and other city services.

The only major expense the city did not touch was its payments to the $260 billion California Public Employees Retirement System.

"We realized we did not have the time or the money to take on a giant behemoth like Calpers," said Stephanie Gomes, Vallejo's vice mayor.

Now city leaders say that growing, and unexpected, costs to Calpers are putting its post-bankruptcy budget under enormous strain. The city budget shows a deficit of $5.2 million for this fiscal year, and that is set to rise to $8.9 million next year unless significant cost savings can be found.

When Vallejo entered bankruptcy in 2008, its annual employer payments to Calpers were $8.82 million, or 11 percent of the city's general fund, according to the city's finance department.

When it exited bankruptcy at the beginning of 2011, the payments to Calpers were just over $11 million, or 14 percent of the fund. The latest budget pegs those payments at $15 million, or 18 percent of the general fund.

The increase comes largely from the recent decision by Calpers to lower its projected investment return rate, from 7.75 percent to 7.5 percent, and to change the way it calculates long-term pension maturity dates.

Those changes mean cities, state agencies and counties must pay rate increases of up to 50 percent over the next decade. Vallejo expects an increase in pension contribution rates of 33 to 42 percent over the next five years.

"Our five-year business plan was based on things we knew," said Deborah Lauchner, the city's finance director.

"Now we have to figure out a way to pay for these new Calpers rates. Every time we react to the last rate change they impose, they come up with another one. I understand they want to improve their funding status, but it's on the backs of the cities."

David Skeel, a bankruptcy law professor at the University of Pennsylvania Law School, said: "Vallejo made a conscious decision under enormous pressure not to mess with Calpers. That is a decision coming home to roost."

Marc Levinson, of the law firm Orrick, Herrington & Sutcliffe, was the lead attorney for Vallejo in its bankruptcy and has the same role for Stockton. He says his clients would welcome pension reform in California, and he is the first to say that contributions to Calpers are a big problem for cities.

But, Levinson said, dealing with the issue is no simple matter.

"How does a city start a new pension plan when it can't pay its bills?", Levinson said. "How can a city break away from Calpers and still retain employees when other jurisdictions have a pension plan?"

Vallejo has met in full its annual payments to Calpers since exiting bankruptcy, and even accurately projected them.

"But just because a cost is projected does not make it sustainable," said Lauchner, the finance manager.

Dan Keen, Vallejo's city manager, said the only way for the city to meet growing pension costs is to get more concessions from city unions - contract negotiations are underway - and to cut services further.

Keen said options were to slow or freeze hiring and make other cost cuts, for example, at the city marina. But he added: "The reality is we don't have anywhere else to cut."

Gomes, the city's vice mayor, said of Calpers: "It's the biggest part of my city's problem. I don't know any city that can afford it."

(Editing by Jonathan Weber and Dan Grebler)