By outward appearances, Stockton, a city of nearly 300,000 on the Sacramento-San Joaquin River Delta, seemed in the mid-2000s to be emerging from decades of struggle.
Next to its gleaming downtown waterfront - a window to the West's largest fresh-water estuary - a beautiful new $46 million glass hockey arena rose in 2005. That same year, the Oakland A's single-A affiliate Ports began play in a new taxpayer-financed stadium, amenities sought by elected officials catering to a wave of new residents fleeing Bay Area congestion and home prices.
High salaries and lucrative benefits were supposed to attract and retain the brightest city workforce to improve the quality of life for its residents. "We spent like the good times would go on forever," said Stockton spokeswoman Connie Cochrane.
But then the recession hit, and the good times went bust. On Monday, the state's 13th-largest city begins federal court proceedings that could end with it becoming the most populous in the nation to successfully enter Chapter 9 bankruptcy, a move opposed by those who lent the money to keep it flush.
On its journey to this point, the Central Valley city has become emblematic of both government excess and the financial calamity that resulted when the nation's housing bubble burst. Its salaries, benefits and borrowing were based on anticipated long-term developer fees and increasing property tax revenue. But those were lost in a flurry of foreclosures.
After the city's population grew by nearly 20 percent between 2000 and 2005 and real estate tripled in value, home prices plummeted 40 percent the following year before bottoming out at 70 percent.
Within two years, Stockton had accumulated nearly $1 billion in debt on civic improvements, money owed to pay pension contributions and the most generous health care benefit in the state - coverage for life for all retirees plus a dependent no matter how long they had worked for the city.
"It's not realistic to think that something like that could be sustained indefinitely," Cochrane said.
Today, its largest creditors are the companies that in 2007, after the economy began to contract, insured the bonds that funded the city's over-extended pension obligations.
The city's deal was risky from the start, said Jeffrey Michael, who as director of the business forecasting center at University of the Pacific has studied the city's struggles.
"It was like refinancing your house and dumping the proceeds into the Wall Street market and hoping your earnings go up faster than the interest rate on your loan," he said.
By 2009, the city began slashing its budget to stay afloat. The police department lost 25 percent of its 441 sworn officers and fire was cut by 30 percent. City staff was cut by 40 percent. The city general fund budget, now $155 million, has been cut by $90 million over three years.
The impacts were felt everywhere. Wells Fargo seized three parking garages when the city defaulted on the $32 million in bonds that financed them. Bond holders also seized the $40 million downtown high-rise that was to become City Hall.
Stockton recorded its highest-ever number of murders in 2011 and 2012, and had three just last Sunday. Last year, an FBI analysis of violent crime made it the 10th most dangerous city in the U.S. Its unemployment rate is 17.5 percent, and it has the third-highest illiteracy rate in the country.
"We are fiscally insolvent, but service insolvent as well and that threatens our ability to attract new business, which we need to recover," Cochrane said.
Last summer, the city began negotiating with creditors, a requirement before entering Chapter 9 bankruptcy. Ten employee unions agreed to temporary wage and benefits cuts.
Retired employees have also been asked to pick up a larger share of health care premiums, closing a $540 million retiree health care cost liability.
But the holders of the biggest share of the debt were the companies that in 2007 insured nearly $165 million in pension bond obligations to allow the city a lower interest rate and make them stable for investors. They were unable to negotiate a deal and want the city to avoid bankruptcy, which would likely allow Stockton to avoid repaying the debts in full.
Officials for the largest creditor, Assured Guaranty, said the city offered them 17 to 18 cents on the dollar for bonds that run through 2048, a deal they plan to argue in court is unacceptable. They say the city should further cut costs and raise taxes and point to city subsidies for the arena and $7 million in uncollected parking tickets.
City politicians also lack the political fortitude to cut contributions to CalPERS, the public employee pension program, Assured officials say. Employees who shared in the wealth when times were flush ought to sacrifice when they are not, they say.
Stockton wants to cut its repayment of the pension bonds without reducing the liability itself, the attorneys wrote.
Those opposing bankruptcy say the city needs long-term wage concessions from public employees, not the one- and two-year deals that were negotiated. The pain must be shared among all debt holders, they argue.
"Stockton has budgeted itself into insolvency. It is now trying to cram down a plan on those it did not favor, instead of focusing on creating a fair, equitable and long-term plan for all stakeholders," said Robert Tucker, managing director of Assured Guaranty.
Few people doubt the city will be successful at a four-day trial and enter bankruptcy, but that won't be the end of litigation. If Chapter 9 protection is approved, a federal bankruptcy judge would still have to decide whether Stockton's bankruptcy plan is fair, or whether it singles out some groups to bear more of the financial burden than others.
"All of us have a stake in ensuring Stockton gets back on its feet," Tucker said.