The Ferguson City Council voted unanimously on Tuesday night to accept a US Department of Justice (DOJ) plan to overhaul the city's police force and municipal court system in the wake of the fatal shooting of unarmed teenager Michael Brown by a Ferguson police officer in 2014.

The council voted 6-0 in favor of a bill authorizing the DOJ's consent decree, reversing its previous rejection of the agreement and likely sparing the St. Louis, Missouri suburb from what stood to be a long and costly legal battle with the federal government. The DOJ sued Ferguson last month after the City Council voted at the last minute to change the terms of the deal, which negotiators had been discussing for months.

After Brown was fatally shot in August 2014, the DOJ launched a lengthy investigation that ultimately documented a pattern of discriminatory and unconstitutional conduct by police, and a municipal court system that essentially treated the city's residents as an ATM, extracting money from them with fines for petty offenses rather than working to ensure public safety.

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

City officials have insisted that their vote in February to reject the DOJ deal was based solely on concerns about the cost of implementation. Jeffrey Blume, Ferguson's finance director, said the deal could cost as much as $3.7 million in the first year alone, and $3 million in following years, potentially bankrupting the city. Others have pointed out that challenging the agreement would lead to a court battle that a lawyer for Ferguson estimated would cost as much as $8 million.

Since the shooting of Brown by white police officer Darren Wilson, an incident that led to widespread demonstrations and unrest in Ferguson, the city has been operating with budget deficit of about $2.5 million a year. Wilson resigned from the department three months after the shooting, and he was not prosecuted after a grand jury declined to indict him.

Vanita Gupta, head of the DOJ's Civil Rights Division, referred to the vote on Tuesday as "an important step towards guaranteeing all of its citizens the prosecutions of our Constitution."

The consent decree requires Ferguson to hire an independent monitor to ensure the city does everything it's supposed to do. The city's police department will implement a new accountability system, and require officers to undergo bias-awareness training. The city will also create an electronic system to track complaints against police, and hire staff to analyze arrest records, use of force incidents, and other police-related matters.

The agreement currently awaits an approval from a judge, but the Justice Department is expected to drop its lawsuit against Ferguson.

After the City Council's vote on Tuesday, Michael Brown Sr., a prominent figure in the protests that followed his son's death, shook hands with Ferguson Mayor James Knowles III and thanked him, according to the New York Times.

"It's beautiful," Brown reportedly said. "It's a good feeling. It let me know that, at the end of the day, you still have to make choices, and hopefully they're the good choices."