The federal government sued Ferguson on Wednesday, one day after the City Council voted to revise an agreement aimed at improving the way police and courts treat poor people and minorities in the St. Louis suburb.

Attorney General Loretta Lynch said Ferguson's decision to reject the deal left the Justice Department no choice except to file a civil-rights lawsuit.

"The residents of Ferguson have waited nearly a year for the city to adopt an agreement that would protect their rights and keep them safe. ... They have waited decades for justice. They should not be forced to wait any longer," Lynch told a Washington news conference.

The Justice Department complaint accuses Ferguson of routinely violating residents' rights and misusing law enforcement to generate revenue — a practice the government alleged was "ongoing and pervasive."

Ferguson leaders "had a real opportunity here to step forward, and they've chosen to step backward," Lynch said.

Ferguson spokesman Jeff Small declined to comment. Messages left with Mayor James Knowles III were not returned.

Ferguson has been under Justice Department scrutiny since 18-year-old Michael Brown, who was black and unarmed, was fatally shot by white officer Darren Wilson 18 months ago. A grand jury and the Justice Department declined to prosecute Wilson, who resigned in November 2014.

But a scathing Justice Department report was critical of police and a profit-driven municipal court system. Following months of negotiations, an agreement between the federal agency and Ferguson was announced in January.

A recent financial analysis determined the agreement would cost the struggling city nearly $4 million in the first year alone. The council voted 6-0 Tuesday to adopt the deal, but with seven amendments.

Hours before the lawsuit was announced, Ferguson leaders said they were willing to sit down with Justice Department negotiators to draw up a new agreement.

That seemed unlikely from the outset. Within hours of the Tuesday vote, Vanita Gupta, head of the Justice Department's Civil Rights Division, said in a statement that the department would take "the necessary legal actions" to ensure Ferguson's police and court practices comply with the Constitution and federal laws.

Knowles said the seven amendments were formulated after the analysis showed the deal was so expensive it could lead to dissolution of Ferguson. The analysis suggested that the first-year cost of the agreement would be $2.2 million to $3.7 million, with second- and third-year costs between $1.8 million and $3 million in each year.

Ferguson has an operating budget of $14.5 million and already faces a $2.8 million deficit. Voters will be asked to approve two tax hikes in April, but approval of both would still leave the city short.

A big part of the cost was the requirement that Ferguson raise police salaries to attract better candidates, including more minority officers. Removal of the pay-raise clause was among the seven amendments.

Ferguson resident Bob Hudgins, 52, applauded the lawsuit.

"I'm proud of my federal government today," said Hudgins, who says he plans to run for City Council. "Ferguson does not have the option to modify the agreement to the extent they have sent back."

Another new provision states that the agreement will not apply to any other governmental entity that might take over duties currently provided by Ferguson. That means, for example, that St. Louis County would not be beholden to the agreement if it takes over policing in Ferguson.

St. Louis County police spokesman Brian Schellman said if the county were ever asked to take over policing in Ferguson, "we would consider the implications of the consent decree before entering into such an agreement."

Knowles doesn't believe neighboring municipal departments would agree to cover Ferguson under the Justice Department's requirements.

Defiance has often defined Ferguson since Brown's death.

Days after the shooting, then-Police Chief Tom Jackson released surveillance video showing Brown's involvement in a theft at a small grocery store shortly before his death, with the burly teenager pushing the store owner. The video's release only heightened anger among protesters.

Knowles has vigorously defended Ferguson. Even as protesters and civil rights leaders called for reforms, the mayor noted that Ferguson was already making changes to municipal courts aimed at easing the burden on people accused of minor violations. In fact, city revenue from court fees and fines has declined by hundreds of thousands of dollars since the shooting.

It's not uncommon for local governments to seek changes to agreements even after negotiations, but the overwhelming majority of investigations still end up in a settlement.

The Justice Department has initiated more than 20 civil rights investigations into law enforcement agencies in the last six years, including in Baltimore and Chicago. In the last 18 months, the department has reached settlements with police departments that included Cleveland and Albuquerque.

There have been occasional disagreements.

In 2012, the Justice Department sued Maricopa County, Arizona, after failing to reach agreement on allegations that the sheriff's office targeted Latinos with discriminatory stops and arrests. County officials voted in July to settle parts of that lawsuit.

The federal government also sued North Carolina's Alamance County following an investigation that alleged biased policing practices against Latinos there. But a federal judge last August ruled in the county's favor, saying the Justice Department failed to prove the sheriff ordered deputies to target Hispanic residents. That case is on appeal.