Los Angeles has had a tough year financially, with the city contending with unexpectedly large legal costs and drawing from its rainy-day fund in order to get by, according to a report released by the city controller Wednesday.

“This is a time for the city to take stock and make sure to not overextend itself,” Controller Ron Galperin said. “The city needs a budget that is based on actual revenues and that builds rather than depletes hard-earned reserves.”

The controller shared his findings on Los Angeles’ finances in his annual preliminary financial report, a 46-page analysis that looks back on how well the city kept to its budget plan over the last fiscal year, which lasted from July 1, 2016 until the end of June.

My latest financial review shows L.A. needs a budget based on revenues that builds hard-earned reserves. Learn more: https://t.co/uXpaEhZasl — Ron Galperin (@lacontroller) October 11, 2017

Angelenos can also delve further into the numbers on the controller’s website for the report, at http://pfr.controlpanel.la .

In the report, Galperin advised that fellow city leaders attend to the health of its reserves, in order to avoid cuts to services during an economic downturn.

“This is a time for the city to take stock and make sure to not overextend itself. The city needs a budget that is based on actual revenues and that builds rather than depletes hard-earned reserves.” — Controller Ron Galperin

He identified several challenges for the city, including employee costs.

“Increases in salaries and pension costs will place constraints on the city’s ability to increase spending in future years, especially if revenues do not continue to grow at such a strong rate,” he said,

Here are some of the concerns Galperin raised about LA’s finances:

Increases to the city’s revenues did not keep up with growth of spending: Expenses grew by 5.2 percent over the previous year, but revenue was slightly behind at 4 percent growth. While revenue did reach “an all-time high” of $5.6 billion, the city was short on some sources of funding. The usual amount transferred from the Department of Water and Power and revenue from the Electric Users Tax together was short by $51 million of what was budgeted. Also, while hotel tax revenue was strong, it was driven by the taxes that Airbnb paid to the city under an agreement established in July 2016. Without the $26 million infusion from the short-term rental company, revenue from the “base” hotel tax grew a bit slower than expected, with growth short by 2.9 percent, or $7 million, the report said.

Threats to L.A.’s rainy-day fund: The city saved 8 percent, or $450 million, of its revenue revenue, or earnings, into its reserves. That is a smaller percentage than the 10 percent the city was able to put into its reserves in 2010. Part of the past year’s budget was balanced by drawing from the reserves, which typically should only be used for emergencies. The controller’s office wrote in the report that “since 2015, efforts to balance the budget, fund new priorities and cover unanticipated expenditures have cut into these reserves, which have dipped to less than 8 percent.”

City unprepared for high liability costs: The city only budgeted about $68 million last year to pay for legal claims, but ended up shelling out more than $200 million to cover several large legal claims, including a housing-related class-action lawsuit and liability claims on police shooting and other types of cases. This was partly what caused expenditure growth to outstrip that of revenue, the report said. The Controller’s Office also wrote that while the $200.8 million in claims likely will not be repeated this coming budget year, but it shows that the city needs to plan more realistically for higher legal costs in future years.

Employee costs continue to grow: Salary costs were up by 4 percent, after the city added staff and covered planned pay increases. The city had also been expecting to receive more contributions from employees, under a retirement plan, but that was reversed, leading to a $19 million shortfall from the budgeted amount. Worker compensation costs were also higher than expected. Meanwhile, employee costs are not expected to get easier to handle for the city in future years. Retirement benefits costs are expected to go up in fiscal year 2018-2019 because the police, fire and city employee pension boards revised their expectations for how much return they will receive on their investments, the report said. The board’s adjustment of the rate of returns they can assume, from 7.5 percent to 7.25 percent, is anticipated to increase city contributions by $100 million.

In addition to calling for stronger revenue sources, Galperin recommended that city leaders think carefully before increasing staff. He also urged more money be fed into the reserves, as well as a “budget stabilization fund,” which is where the city puts its “excess tax revenue” to used specifically for covering budget shortfalls.

The controller’s office also noted some bright spots, such as strong revenue from property, business, sales and hotel taxes, and building permit fees were also another major source of funding. The city’s debt payment cost was at its lowest since 2004, and its healthcare costs went up 6.4 percent, a much smaller increase to the 20 percent national average.