The city of Stockton, Calif., about 90 minutes east of San Francisco, is broke and on the brink of bankruptcy. Stockton's road to insolvency is a long one, and it appears that, financially speaking, everything that could go wrong in Stockton did.

If Stockton can't solve its budget crisis, it would be the largest American city to go bankrupt.

The City's Seen Better Days

Weber's Point in downtown Stockton is on a marina that symbolizes the city's pain and promise. Stockton is an inland Central Valley city of nearly 300,000 residents. Beyond this marina is the San Joaquin Delta, with a channel to the San Francisco Bay. On the waterfront, there is also a sports arena, a new baseball park and a renovated hotel. They are all reminders of Stockton's better days.

Stockton's aging City Hall and the office of Mayor Ann Johnston are just a few steps away from the waterfront. The mayor points to a series of large photos in her office of those major downtown landmarks — all developed in the last decade.

"When we went on a real spending spree and built the arena, the ballpark, a lot of community infrastructure — did a whole lot of things to improve the community that were bonded," she says. "I mean, these were all financed through municipal bonds."

In other words, the city built them with borrowed money to the tune of more than $300 million.

Housing Boom And Bust

City leaders were confident they could repay that debt because Stockton was riding the crest of the housing boom.

"Stockton had become the affordable housing for the Bay Area, so we saw an influx of many Bay Area residents coming to Stockton, buying brand new homes at very reasonable prices," Johnston says. "And the city leaders thought this was going to continue forever."

Today, those homes that sold for more than $400,000 are now going for less than $150,000. Plus, Stockton has one of the highest foreclosure rates in the country. Property tax revenues have crashed. Unemployment runs at almost 20 percent.

At a downtown pawn shop, owner Tim Cassidy sees a lot of new customers.

"Both in good times and bad times, we see the best and the worst," he says. "It's a very tough situation for a lot of people, unfortunately."

Cassidy says Stockton might have been OK if the housing market hadn't crashed.

"When the real estate was booming and the money was coming in, naturally the politicians, being politicians, made everybody happy," he says. "[The] police department, fire department all got handsome wages and retirement plans — same as city officials."

A 'Ponzi Scheme' Of Benefits

Now, the bill for those public employee benefits has come due. At a recent news conference, Stockton City Manager Bob Deis said that at one point in the 1990s, Stockton offered one of the most generous health plans in California.

"City employees only had to work one month, and then they could retire, and the city would pick up their insurance for free for them and their spouse for the rest of their lives," he said.

Deis said that plan resembled a "Ponzi scheme."

"Right now, we have an unfunded liability in the retiree health program around $450 million," he said.

Deis said the city is looking at a $20-million deficit in a $160-million budget. Stockton has already cut nearly 100 police officers in the past three years, in a city with a notoriously high crime rate.

Who's Next?

The City Council has approved a plan to stop paying its creditors and to enter a state-mandated mediation process with its bond holders and employee unions. If those talks fail, bankruptcy is likely.

Back in her office, the mayor says if there is any silver lining here, perhaps it's in the lesson for other California cities.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.