The City of Baltimore and the Justice Department announced Thursday that they have agreed on a court-enforceable consent decree to institute sweeping reforms in Baltimore's police department.

The 227-page consent decree, which still needs to be approved by a federal judge, calls for an independent federal monitor to observe the department, as well as a community oversight task force. It instructs police to use de-escalation tactics before resorting to violence and calls for police to be instructed on implicit bias and victim-centered practices for handling sexual assault cases.

Among other things, the agreement calls for all vans used to transport people in custody to have functional video recorders turned on for the entire time the detainee is in the vehicle.

"The agreement is designed to increase transparency, public oversight [and] accountability," Mayor Catherine Pugh says. And, she said, it calls for "training, training, training, training."

Attorney General Loretta Lynch says the agreement addresses three central issues: effective and constitutional policing, restoring community trust in law enforcement and enhancing public and officer safety.

"It reflects significant input from the people of Baltimore," Lynch said. "It's all of you. It's your commitment. It's your dedication."

The city and the federal government spent five months negotiating the agreement, The Baltimore Sun reports.

"Baltimore city officials and the Justice department attempted to put an agreement in place by November, but were unable to do so," reports Kenneth Burns of member station WYPR. "Pugh wanted a consent decree in place before President-elect Donald Trump took office next week."

The agreement is the result of a lengthy civil rights investigation into the Baltimore police.

In 2015, when Freddie Gray died after sustaining an injury while in police custody, Baltimore was roiled by protests. Then-Mayor Stephanie Rawlings-Blake asked the Justice Department to open an investigation.

The DOJ spent more than a year looking at the department, then issued a scathing report. The document described widespread racial bias, use of excessive force, repeated patterns of unconstitutional arrests and hostility towards women and LGBT civilians, as well as other civil rights violations. Rawlings-Blake called it "challenging to hear."

After the report was issued, Vanita Gupta, the head of the Justice Department's Civil Rights Division, told NPR a court-enforceable consent decree would offer an "opportunity" for cooperation between the city and the federal government.

Gupta said that in Baltimore, even before the Justice Department began investigating, "a lot of people ... from community groups to the Fraternal Order of Police to others," recognized the need for reform and documented the problems that they saw.

Such consent decrees, negotiated between police departments and the Justice Department, are a common outcome of Justice Department investigations into bias and excessive use of force.

They've been issued in cities ranging from Ferguson, Mo., to Newark, N.J.

Some troubled police departments have been covered by consent decrees for decades — for instance, as NPR's Greg Allen reported last summer, Baton Rouge, La., has been under a consent decree for more than 30 years.

The Associated Press reports that the consent decree in Baltimore is "meant as a capstone" for the Obama administration, which has focused on civil rights issues and policing reform. The wire service continues:

"The agreement is intended to be remain in place long after Lynch leaves office, though civil liberties advocates are concerned that Sen. Jeff Sessions, the Alabama Republican who's been nominated to replace her, may not look to enforce consent decrees with the same vigor."The Baltimore city government signed off on the agreement Thursday. A hearing will allow for public comment on the agreement before it's approved by a federal judge."Copyright 2017 NPR. To see more, visit