CAMDEN, N.J. — Two gruesome murders of children last month — a toddler decapitated, a 6-year-old stabbed in his sleep — served as reminders of this city’s reputation as the most dangerous in America. Others can be found along the blocks of row houses spray-painted “R.I.P.,” empty liquor bottles clustered on their porches in memorial to murder victims.

The police acknowledge that they have all but ceded these streets to crime, with murders on track to break records this year. And now, in a desperate move to regain control, city officials are planning to disband the Police Department.

The reason, officials say, is that generous union contracts have made it financially impossible to keep enough officers on the street. So in November, Camden, which has already had substantial police layoffs, will begin terminating the remaining 273 officers and give control to a new county force. The move, officials say, will free up millions to hire a larger, nonunionized force of 400 officers to safeguard the city, which is also the nation’s poorest.

Hardly a political battle of the last several years has been fiercer than the one over the fate of public sector unions. But Camden’s decision to remake perhaps the most essential public service for a city riven by crime underscores how communities are taking previously unimaginable steps to get out from under union obligations that built up over generations.