With San Bernardino, Calif., in bankruptcy, basic services have dwindled. Here, discarded materials in Carlos Teran's neighborhood. Photo: Monica Almeida/The New York Times The gunshots ripped through a house party here, an hour before midnight on New Year’s Eve, wounding three and killing one. It was a brutal, if fitting, cap to a year that left this city bloody and broke.

Five months after San Bernardino filed for bankruptcy — the third California city to seek Chapter 9 protections in 2012 — residents here are confronting a transformed and more perilous city.

After violent crime had dropped steadily for years, the homicide rate shot up more than 50 percent in 2012 as a shrinking police force struggled to keep order in a city long troubled by street gangs that have migrated from Los Angeles, 60 miles to the west.

“Lock your doors and load your guns,” the city attorney, James F. Penman, said he routinely told worried residents asking how they can protect themselves.

Read more at the NY Times