SACRAMENTO — California has come a long way to dig itself out of budget deficits, but the state remains on shaky ground due to nearly $400 billion in unfunded liabilities and debt from public pensions, retiree health care and bonds, financial analysts say.

“Yes, the state’s budget is balanced if you are looking at what they are required to spend cash on this year, but not when you look at their expenses,” said Gabe Petek, a credit analyst with Standard & Poor’s.

The high debt and unfunded liabilities have resulted in the state’s rating lagging behind other states, Petek says. California saw its bond rating rise last year from A+ to AA-, the highest level the state has had in 14 years. Good bond ratings are a sign of a strong budget and financial management and allow states to pay lower interest rates when selling bonds.

“Compared to other states, though, California has one of the lower ratings,” Petek said.

And the reason is clear, he said. It’s California’s debt and liabilities that are concerning financial analysts, particularly the state’s rapidly growing unfunded retiree health care costs, which grew more than 80 percent over the past decade. California has promised $74 billion more in health and dental benefits to current and retired state workers than the state has put aside.

Major liabilities

Without changes, the state estimates that unfunded liability would grow to $300 billion by 2047.

“These liabilities are so massive that it is tempting to ignore them,” Gov. Jerry Brown said last month in his State of the State speech. “We can’t possibly pay them off in a year or two or even 10. And there is little satisfaction in the notion of chipping away at an obligation for three decades to pay for something that has already been promised. Yet, it is our moral obligation to do so — particularly before we make new commitments.”

H.D. Palmer, spokesman for the Department of Finance, said the governor is focused this year on reining in retiree health care costs. The retirement plan is one of the most generous in the nation, covering 100 percent of retirees’ medical costs if they worked for the state for 20 years. Currently, the state pays only for the cost of providing care to retired workers, and does not put money aside for those who will retire in the future.

“The pay-as-you-go model is clearly not going to be sustainable over the long haul, particularly with a workforce that is aging,” Palmer said. “Roughly 1,000 people turn 65 in California each day, a number of those are state workers. What does that mean for the state in terms of long-term fiscal planning?”

Last year, the state successfully negotiated with the professional engineers union to have those workers contribute half of 1 percent to their retiree health benefits in 2017 and 2018 and 1 percent of their salary in 2019. The state will match those contributions.

Pension debt

Engineers, however, will see their contributions offset by a 5 percent raise this summer and a 2 percent raise in 2017.

The engineers union also agreed to increase the amount of time it takes to earn full retiree health benefits from 20 years to 25 years and decrease the coverage the state pays for from 100 percent of premiums to 80 percent. Those changes affect only new employees.

Palmer said the changes along with the prefunding of retiree health will be a model as the state begins negotiations with other unions this spring.

State Sen. John Moorlach, R-Costa Mesa (Orange County) said he’s skeptical that the state’s model for funding retiree health benefits is the right move. Moorlach said offering raises to employees to offset their contribution to their retiree health benefits puts more pressure on the pension system, which pays retirees based on their salaries.

“As we say in accounting, it’s missing the sizzle of the deal,” said Moorlach, a certified public accountant and financial planner.

Moorlach said he’s concerned with the state’s pension debt — the teachers retirement system alone faces a $72.7 billion unfunded liability. The most recent estimate in 2014 for the California Public Employees’ Retirement System shows a $43.2 billion unfunded liability.

Bond debt

Bond debt also has risen substantially in California, with the state’s reliance on borrowing for infrastructure resulting in 1 of every 2 dollars spent on those projects going to pay interest, according to the Department of Finance.

Bonds are approved by voters and generally used to pay for infrastructure, such as building schools and roads.

From 1974 to 1999, California voters approved $38.4 billion of general obligation bonds. Since 2000, voters approved more than $103.2 billion. The state is paying on $86.8 billion in bond debt with another $32.3 billion expected to be issued in the coming years.

In November, voters will be asked to approve a $9 billion school construction bond.

The state has $77 billion in deferred maintenance needed to fix roads, highways and bridges, which Brown said is likely to require a new tax or fee.

All these debts and liabilities should concern taxpayers, said Autumn Carter, executive director of California Common Sense, a Mountain View nonpartisan policy group that does fiscal and budget analysis. When the next recession hits, Carter said, the state’s payments on pensions, retiree health and bond debt will put pressure on social services and other programs.

“There is nothing that says we have to fall into financial ruin,” Carter said. “There is still time to turn it around. We can still attack debt and tackle the cost growth associated with pensions and retiree health care, but we have to be willing to do it.”

Melody Gutierrez is a San Francisco Chronicle staff writer. E-mail: mgutierrez@sfchronicle.com Twitter: @MelodyGutierrez