Police officers here, as in many California cities, can retire as young as 50 with 30 years of service and receive 90 percent of their final salary every year — drawing those pensions for decades. Police unions say the fault lies with state and local politicians who failed to adequately fund the pension system over the years, and inflated benefits during boom years. Others wonder whether such salaries and pensions were ever affordable, particularly in cities as small and struggling as this. In Desert Hot Springs, for example, for every dollar that the city pays its police officers, another 36 cents must be sent to Calpers to fund their pensions.

The average pay and benefits package for a police officer here had been worth $177,203 per year, in a city where the median household income was $31,356 in 2011, according to the Census Bureau. All of this had gone largely unnoticed until becoming the center of debate during the recent municipal election.

“I was in shock, like everybody else was,” said Regina Robinson of the day she learned how much some city workers were earning. She owns Just Gina’s hair salon, one of the few businesses on the downtown stretch of Palm Drive, the main street.

Mr. Adams said that California’s rich police pensions were first offered to prison guards by former Gov. Gray Davis more than a decade ago. The move set off a chain reaction, with the California Highway Patrol soon clamoring for the deal, and then city police officers all over the state.

This is not Desert Hot Springs’ first experience with fiscal problems. In 2001, it went bankrupt after losing a $10 million lawsuit brought by a developer who complained that the city was thwarting his efforts to build affordable housing. The city had to borrow to pay the judgment and is still paying off that debt — a struggle for a working-class town.

A sharp increase in gang and drug crimes in the 1980s led the city to disband its police force and contract with the Riverside County sheriff for law enforcement, but that proved highly unpopular and, in 1997, the city re-established its force.