ST. LOUIS - A federal judge approved an agreement Tuesday between Ferguson and the U.S. Justice Department that calls for sweeping changes in the Missouri city where 18-year-old Michael Brown was fatally shot by a police officer. U.S. District Judge Catherine Perry issued her ruling after a public hearing of several hours in St. Louis, where nearly three dozen people spoke, and many others had submitted written comments. Perry said the settlement is a "reasonable resolution" that avoids an extensive court battle.

ST. LOUIS � A federal judge approved an agreement Tuesday between Ferguson and the U.S. Justice Department that calls for sweeping changes in the Missouri city where 18-year-old Michael Brown was fatally shot by a police officer.

U.S. District Judge Catherine Perry issued her ruling after a public hearing of several hours in St. Louis, where nearly three dozen people spoke, and many others had submitted written comments. Perry said the settlement is a "reasonable resolution" that avoids an extensive court battle.

"I think it's in everyone's best interest and I think it's in the interest of justice," she said.

The settlement calls for diversity training for police; the purchase of software and the hiring of staff to analyze records on arrests, use of force and other police matters; outfitting all officers and jail workers with body cameras; the hiring of a team to monitor progress; significant municipal court reforms; and other changes.

Mayor James Knowles III said after the hearing that the city has already implemented many reforms, and will act swiftly on others to "move into compliance as soon as possible." During the hearing, Knowles told Perry the agreement "is an important step in bringing this community together and moving us forward."

Vanita Gupta, head of the Justice Department's Civil Rights Division, said in a statement that the agency looks forward to working with the city "as it implements the decree and continues the essential work to create a police department that the Constitution requires and that residents deserve."

Ferguson has been under scrutiny since Brown, who was black and unarmed, was fatally shot by white police officer Darren Wilson in 2014. Brown's death was a catalyst in the national Black Lives Matter movement. A grand jury and the Justice Department cleared Wilson, who resigned from the police force in November 2014, but the shooting led to a Justice Department investigation.

That inquiry found alarming patterns of racial bias in policing and a municipal court system that generated revenue largely on the backs of poor and minority residents. The Justice Department's critical report in March 2015 prompted the resignations of Ferguson's city manager, police chief and municipal judge. All three were white men who have since been replaced by black men.

Ferguson leaders and Justice Department officials spent months negotiating the settlement. But in February, after a series of public hearings, the City Council rejected it, mostly over concerns the cost could bankrupt Ferguson. The Justice Department sued the next day. In March, after receiving some assurance that the cost wouldn't be as high as feared, the City Council approved the deal, expected to cost about $2.3 million over three years.

Christy Lopez of the Justice Department said the agreement isn't perfect, but it will help Ferguson residents.

"We want Ferguson to be known for how it responded to this crisis," Lopez said. "How it came back stronger than ever."

The agreement calls for changes to start happening soon. Within 30 days, the city is required to adopt amendments reforming the municipal code and eliminating laws deemed unnecessary, such as one governing how to walk in a crosswalk. The city has 60 days to develop and implement policies for the use of police body and car cameras. Also within 60 days, the finance director must be removed from the role of municipal court oversight, and new efforts must be implemented to help low-income residents pay court fines and fees.

New screening policies for police hires must be in place within 90 days, and the hiring of a monitor team is due. The city has 180 days to develop policies for "critical incidents" involving police, and to come up with a plan on attracting and retaining a diverse police force.

Felicia Pulliam, a black Ferguson resident, said at the hearing that city officials have continually denied that Ferguson has a race problem, leaving her to wonder if they will take the agreement seriously.

"They can't be trusted," Pulliam said. "They never, ever, tell the truth."

John Powell, a white Ferguson resident, told the judge that "stubborn and pervasive racism" exists in the St. Louis suburb.

Debra Kennedy, who is black, said she doubted the settlement would do any good and wondered why police supervisors "who have been ignoring our community's complaints for decades are suddenly going to start abiding by their policy manuals simply because the Department of Justice says they will."

But others said the Justice Department investigation was biased in favor of protesters while overlooking reforms the city already made.

"I think the DOJ wanted to wipe Ferguson off the map," resident Jean Boettcher said. "This should be a warning to the rest of the United States."

Others said the federal government shouldn't meddle in Ferguson's business. Kelly Schlereth, who has lived in Ferguson for more than two decades, wrote that the Justice Department is trying to make up for not finding cause to criminally charge Wilson.

"The DOJ has consistently been biased in their investigation into the practices of the Ferguson police department," Schlereth wrote.