The tide of uncertainty that’s roiled financial markets is raising new concerns about California’s underfunded retirement systems for millions of teachers, firefighters, police officers and other public sector employees.

Former civil servants aren’t in any immediate danger of losing their retirement checks. But if the stock market volatility triggered by President Donald Trump’s on-again, off-again tariffs continues, already cash-strapped cities and public agencies worry they may need to pony up even more money to help cover employee pension costs, which have soared in recent years with increases in worker salaries and more baby boomers reaching retirement.

“With this whiplash policy approach, cities are just sort of holding on for dear life,” said Dane Hutchings, a Sacramento lobbyist representing local governments.

As stocks plummeted after Trump announced his latest tariff plan to tax nearly all imports, the California Public Employees’ Retirement System, the nation’s largest pension fund for state and local employees, lost around $20 billion from its investment portfolio in a matter of days.

CalPERS has recouped some of those losses as the market has partially rebounded since Trump said he would pause most of the highest tariffs, except those on China, for at least 90 days. As of late last week, CalPERS held roughly $514 billion in investments, according to the latest available reporting.

Still, a sustained downturn could put the fund in danger of missing its annual 6.8% target for investment returns.

And the California State Teachers’ Retirement System, a roughly $350 billion pension fund for public school educators, could fail to meet its 7% goal. The deadline to realize those gains is June 30.

If that happens, thousands of cities, counties, school districts, fire departments, utilities and other state and local agencies that rely on the two funds could be forced to increase their already steep contributions for employee pensions.

Unlike most private retirement plans, public pension payments are guaranteed and amounts do not change generally with market fluctuations.

“California cities are already facing rising pension costs and increased pressure on their budgets,” Johnnie Piña, a legislative advocate with the League of California Cities, said in an email. “When CalPERS misses its investment targets, cities must fill the gaps, making it that much more difficult for cities to maintain core services to residents.”

Oakland, for instance, is staring down a $140 million budget shortfall — largely due to a slowdown in real estate tax revenue and ballooning police overtime costs — even after moving to temporarily close four fire stations and lay off dozens of employees. Retirement benefits have climbed over the years to make up about 14% of the city’s current $1.1 billion general fund budget, which includes spending that isn’t automatically designated for a specific purpose.

Oakland officials did not return a request for comment about its pension payments.

San Jose, which has its own retirement system separate from CalPERS, is facing a $60 million deficit. More than 15% of its $2.1 billion general fund goes to employee pensions.

In a statement, Mayor Matt Mahan’s office said San Jose tracks its investment returns every five years instead of setting an annual target, allowing the city to “not overreact to up or down swings in the market.”

At the state level, Gov. Gavin Newsom has said his $322 billion budget proposal should yield a $363 million surplus. However, that projection could be complicated if Californians’ personal stock market earnings — which the state relies on heavily for tax revenue — take a hit.

Next year, the state expects to pay around $9.1 billion in retirement benefits, or about 3% of its total budget. State finance department officials declined to comment on whether smaller-than-expected returns for the two pension funds could raise that amount.