Image caption Stockton was ranked as America's Most Miserable City in 2010

The Californian city of Stockton has become the largest US city in decades to file for bankruptcy, after failing to make a deal with its creditors.

Mayor Ann Johnston told the city council the move was "the most heart-wrenching decision" they had faced.

Stockton faces a projected $26m (£17m) budget shortfall.

The river port city of 290,000 - which lies 90 miles (144km) east of San Francisco - suffered badly during the US housing market crash.

Filing for Chapter 9 bankruptcy protection allows the city to hold some of its creditors at bay while still paying for basic services like its police and fire department.

Drastic cuts

Stockton made the filing at a Sacramento federal court on Thursday.

It is the largest US city to go bust since Cleveland, Ohio did so in 1979.

The fact is that the police department is shrunk and crime is crazy and there are no jobs Mike Brooking, Stockton coffee shop owner

The housing boom was good to Stockton. Flush with property tax, the city developed its waterfront, with a new marina and sports complex, and negotiated generous pension and healthcare benefits for city employees.

But in the past three years, officials in the city have dealt with $90m in deficits through a series of drastic cuts.

They eliminated a quarter of the city's police officers, one-third of the fire staff, and 40% of all other employees. They also cut wages and medical benefits.

Stockton's unemployment and violent crime rates now rank among the top in the nation. One in every 195 Stockton homes filed for foreclosure in May, according to RealtyTrac.

More than 15% of the population of Stockton is unemployed - nearly double the national average.

City buildings have been repossessed and "Out of Business" signs are a common sight.

City Hall was due to move into a new building, but since Stockton has run out of money, the new building has been repossessed.

Leaving town

Mike Brooking, 50, a Stockton native and coffee shop owner, blames city officials. He says they paid people unreasonably generous pensions and medical benefits.

Image caption Even City Hall buildings have been repossessed

"They gave employees guaranteed healthcare when they're gone - and their families," Mr Brooking said.

"To people who worked there for one month! They couldn't afford it then. They can't afford it now. No-one else has those guarantees.

"The fact is that the police department is shrunk and crime is crazy and there are no jobs. I think this is going on throughout the whole Central Valley, in the whole country and Europe."

Gusto Gifts, just down the street from Mr Brooking's cafe, was shuttered last month.

The shop's main business was selling passport photos, according to George Estrada, a 35-year-old computer programmer who worked there part-time and helped sell off its assets on the Craigslist website.

Resident's view "This was a great town to live in when I was growing up, it was thriving with lots of commerce. But now when I walk around the city I see lots of boarded-up businesses. The city has put itself in a box with no way out. Bankruptcy is the only way. Unfortunately, the same people making this decision are cut from the same cloth that put us here in the first place. I'm relocating due to the current unchanging status of the city. It's a crime-ridden, out-of-control situation. The main problem here is crime - I live in a nice area but even this morning I heard gunshots. Police officers are leaving the force because it's too dangerous for them and they can make better money elsewhere. When people lose their jobs and their homes, of course the crime rate shoots up. My heart breaks and my blood boils when I read the crime reports. Senior citizens being beaten and robbed on a daily basis. Home invasions. I refuse to let my adult children visit me here - I go to them. That's how bad it is. We need protection more than we need bankruptcy." Frank John Colli, Stockton, California

"Wells Fargo Bank took over a few parking garages that the city owned," Mr Estrada says.

"Now they own the building City Hall is in. You might well call it Wells Fargo town."

He added that it is very difficult for young skilled workers to find jobs. "Everybody here wants to leave town," he said. "People want to move out and find jobs in San Francisco, or Sacramento."

Stockton lies in the heart of one of America's most productive agriculture regions.

Record homicides

The city is built on an inland waterway, navigable to the nearby San Joaquin River, where the produce of California's fields are transported from Stockton's port.

The city has always relied on agriculture - but Mr Estrada and other educated young people have no interest in working in California's blistering hot fields picking cherries, almonds or other crops.

And the canneries are largely gone while other agricultural jobs have become automated.

A Wal-Mart department store is due to open soon in Stockton, "but nobody wants to work there", says Mr Estrada.

Mr Estrada already has a job as a computer programmer, but wants to leave the city because he says his opportunities in Stockton are too limited.

He is looking for jobs all over the San Francisco Bay Area, but says that the older members of his family would never leave Stockton.

He says the increase in crime is the hardest part about living in Stockton and you just never know when something might happen. The police agree.

Image caption During the housing boom, the city lavished money on its waterfront

"We've seen a rise in violent crime here in Stockton," says police officer Joe Silva, a Stockton native and 16-year veteran of the force.

"Last year was a record setting 58 homicides and so far this year we've had 31. This time last year we had 17."

Many blame the surge in violence on Stockton's economic woes. In 2008, the city had a budget for 441 police officers.

Today they have 317, according to Officer Silva, who adds that there is some optimism within the force now because of new Police Chief Eric Jones.

Officer Silva said they would have a few more police officers sworn into the force on Thursday and new strategies for policing some of Stockton's most dangerous neighbourhoods.

The changes will hopefully keep Stockton off this year's Forbes list of "America's Most Miserable Cities".

Last year, the city was ranked the 11th most miserable. In 2010, Stockton was placed number one in terms of misery.