FERGUSON, Mo. — When the City Council took the defiant gamble last week of challenging parts of an agreement it had negotiated with the federal government to overhaul its Police Department and courts, it argued that the costs of the deal would drive the city into bankruptcy.

But now the Department of Justice has responded with a civil rights suit against this municipality, outside St. Louis, which was shattered by violence in 2014 after a police shooting of an unarmed black man. And the city faces the specter of a lengthy, costly legal battle that has left many here worrying whether their community is hurtling toward ruin.

“I just feel sad,” said Bridgett Lewis, who owns a restaurant, Drake’s Place, with her husband. “People are saying it’s going to be the end of Ferguson and Ferguson is going to go broke. Some people are saying: ‘Well, that’s the cost of racism. They should have thought about it before they did all this stuff.’ We all are worried and concerned about how this is going to impact Ferguson.”

Rocked by protests and spasms of violence after a white Ferguson police officer fatally shot Michael Brown, a black 18-year-old, in August 2014 — and again after the officer was not charged — the city of 21,000 has had to deal with both the angry aftermath and divisions as well as with the costs.