The Ferguson, Missouri, City Council reversed its previous position and voted Tuesday night to accept the changes to its courts and police departments that were recommended by the U.S. Justice Department in the wake of the killing of Michael Brown, an unarmed black 18-year-old, by a police officer.

The council voted unanimously, 6-to-0, to accept the Justice Department’s changes, and likely spared itself from an expensive legal battle.

Under the Justice Department’s recommendations, officers would take a diversity-training course and would be trained to first de-escalate a situation. Additionally, the city would buy software and hire staff to review arrest data to prevent discrimination, and all supervisors and officers would be fitted with body cameras within 180 days. The arrangement would also require Ferguson to hire an independent monitor to ensure the city lives up to the agreement.

After Brown’s death, the government released a report that found Ferguson’s officers regularly and unconstitutionally stopped and searched blacks in the community. It also found the courts used officers as a way to generate revenue through constant harassment and unnecessary fines.

“These violations were not only egregious, they were routine. They were encouraged by the city in the interest of raising revenue," Attorney General Loretta Lynch  said in February. "They were driven, at least in part, by racial bias and they occurred disproportionately against African American residents of Ferguson.”

The Justice Department outlined a list of adjustments and changes Ferguson needed to make, but the city voted against them in February, citing, in part, costs. The city’s finance director estimated that complying with the agreement could cost nearly $7 million. The Justice Department responded with a lawsuit, saying the city’s officers engaged in “discriminatory policing, unconstitutional stops, searches and arrests, and the use of unreasonable force.”

Tuesday’s agreement still needs approval from a judge, but the Justice Department is expected to drop its lawsuit against the city.