FILE - In this Sunday, Aug. 9, 2015, file photo, protesters march to mark the one-year anniversary of Michael Brown being shot and killed by Ferguson Police Officer Darren Wilson. Years before the high-profile deaths of Brown, Trayvon Martin and Freddie Gray, more than half of African-American millennials indicated they, or someone they knew, had been victimized by violence or harassment from law enforcement, a report released Wednesday, Nov. 4, 2015, says. (AP Photo/Jeff Roberson, File)

FERGUSON, Mo. (AP) — The federal government sued the city of 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.

The civil-rights lawsuit filed by the Justice Department alleged that Ferguson routinely violated residents’ rights and misused law enforcement to generate revenue — a practice the government said was “ongoing and pervasive.”

Attorney General Loretta Lynch said Ferguson’s decision to reject the agreement left the department no choice except to sue.

“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.”

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 to be announced, Ferguson leaders said they were willing to sit down with Justice Department negotiators and hammer out a new agreement.

“We ask that if they (the Justice Department) feel there needs to be some additional changes to the agreement, we sit down and talk,” Knowles said.

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.

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.”

Days after Brown’s death, then-Police Chief Tom Jackson released surveillance video showing Brown’s involvement in a theft at a small grocery store just moments before the shooting, 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.

Samuel Bagenstos, the former No. 2 official at the Justice Department’s Civil Rights Division, warned that the federal agency “is serious about bringing a lawsuit if they don’t get a deal.”

“If Ferguson insists on making significant changes to the deal they’ve already worked out, that’s probably not going to work out well for them,” said Bagenstos, now a law professor at the University of Michigan. “And I think at the end of the day, Ferguson understands that, and we’ll probably see a deal pretty soon.”

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.