ST. LOUIS -- A Missouri state judge on Monday gutted a bipartisan law, passed in the wake of the unrest in Ferguson, that aimed to prevent small municipalities from using their courts to significantly subsidize their budgets. That financial strategy has long fueled tension between police and the communities they serve in St. Louis County.

The law, SB 5, lowered the caps on the percentage of a town budget that can come from traffic fines and fees.

The suit was brought by a dozen St. Louis County municipalities that derive large portions of their budgets from slapping hefty fines and fees on often low-income people for minor violations. City officials maintained that their small communities were being unfairly targeted.

Judge Jon Beetem of the Cole County Circuit Court agreed that the 12.5 percent budget cap that applied only to St. Louis County municipalities did unfairly target St. Louis County municipalities. He issued a permanent injunction against that and other portions of the legislation on Monday.

The 20 percent statewide cap established by SB 5 remains in effect. But Beetem also tossed out the law's minimum standards for police departments, which he found to be an unfunded mandate in violation of the Missouri Constitution.

Missouri Attorney General Chris Koster (D) announced Tuesday morning that he would appeal the circuit court’s ruling.

State Sen. Eric Schmitt (R), who had originally introduced the legislation, said in a statement that Beetem’s ruling was another example of why Missourians “have lost faith” in the justice system.

“For years citizens have been abused by local bureaucrats who have treated them like ATMS to fund their bloated budgets, salaries and perks,” Schmitt’s statement said.

ArchCity Defenders, which represents poor defendants in St. Louis County, tweeted that its people had met with 16 individuals “jailed because of their poverty” on the very night the judge's order was issued.

In his statement on Tuesday, Koster noted that the legislation was passed “to stop municipalities from abusing citizens through excessive ticketing practices.”

“A municipality should not depend upon prosecuting its citizens in order to fund the cornerstone functions of government,” he said.

Earlier this month, local lawmakers in Ferguson approved a deal with the U.S. Department of Justice that would force several changes in the way that city’s municipal court operates. The DOJ found that officials in Ferguson had worked in concert to raise revenue through aggressive ticketing methods that were not based upon public safety needs.

The municipalities that filed the lawsuit against SB 5 are some of the most reliant on fines and fees. Normandy, the lead plaintiff, raked in nearly $2 million through court fines and fees in 2013, and almost $1.5 million last year. The town has a population of about 5,000 people.