A federal judge on April 19 approved an agreement requiring reforms at the Ferguson Police Department. (Jabin Botsford/The Washington Post)

A federal judge on Tuesday approved a legal agreement between the Justice Department and the city of Ferguson, Mo., requiring broad reforms at the local police department to resolve claims that its officers routinely violated the rights of black citizens, court records show.

U.S. District Judge Catherine D. Perry formally approved the consent decree after soliciting opinions from residents, the records show. According to the Associated Press, the judge said the settlement was “in everyone’s best interest, and I think it’s in the interest of justice.”

The agreement settles the Justice Department’s lawsuit against the city and requires officials to institute a wide variety of changes, including providing bias-awareness training for city officers and implementing policies to ensure the department’s “stop, search and arrest” practices do not discriminate on the basis of race. An independent monitor will be selected to make sure it is implemented.

Ferguson’s council had approved the agreement last month, though that itself was not a painless process, and it still needed the judge’s sign-off. The city and the Justice Department had seemingly reached the same agreement in January, but council members, worried about the costs it would impose on the city, initially balked at signing. They did so only after the Justice Department filed a lawsuit, which could have prompted a costly and protracted legal battle.

Vanita Gupta, the head of the Justice Department’s Civil Rights Division, said in a statement: “Now that the consent decree has been approved by the court, the department is looking forward to working with the city of Ferguson as it implements the decree and continues the essential work to create a police department that the Constitution requires and that residents deserve.” A city of Ferguson spokesman did not immediately return an email seeking comment.

Ferguson recently tapped Delrish L. Moss, a Miami police major running the department’s public information, to take over as police chief, and he has said the department needs to recruit so that it becomes more reflective of the community it patrols. When the chief’s hiring was announced, Ferguson Mayor James Knowles III said in a statement: “We understand the past 18 months have not been easy for everyone, but the city is now moving forward and we are excited to have Major Moss lead our police department.”

This post has been updated.