Baltimore officials on Thursday announced an agreement with the Justice Department to revamp the city’s police department in an effort to end years of troubling practices uncovered after the death of Freddie Gray.

Attorney General Loretta E. Lynch and Baltimore Mayor Catherine E. Pugh outlined significant moves to overhaul training of the city’s police officers to prevent discriminatory policing and the use of excessive force.

The 227-page agreement, known as a consent decree, was approved by the city government and filed in U.S. District Court on Thursday. The court-enforceable agreement must be approved by a federal judge.

“The city’s police department has begun some critical reform, but we know there is much more to be done,” Pugh said during a news conference, flanked by Lynch and Baltimore Police Commissioner Kevin Davis.

The announcement comes in the final stretch of the Obama administration, which has made ending heavy-handed and biased police practices a signature issue. Lynch has pushed to secure legally binding reform agreements with other cities, including Chicago and Ferguson, Mo.

President-elect Donald Trump has expressed support for more aggressive policing tactics. His pick to lead the Justice Department, Sen. Jeff Sessions (R-Ala.), has declined to say whether he would leave any agreements from the Obama administration unchanged.

Lynch said Thursday that the consent decree “is binding and will live on.”

The changes “will help ensure effective and constitutional policing, restore the community’s trust in law enforcement, and advance public and officer safety,” she said in a statement.

The agreement follows months of negotiations and comes after the Justice Department released a report in August alleging that Baltimore police had engaged in a pattern of using excessive force, making stops, searches and arrests without necessary justification and were disproportionately stopping African Americans.

Lynch took over as attorney general on the day of Gray’s funeral. The 25-year-old’s death from injuries suffered in police custody sparked riots in Baltimore in April 2015, and led to the investigation.

Six Baltimore officers were charged in connection with the arrest of Gray, who suffered a fatal neck injury in the back of a police van. The criminal case ended with the top prosecutor failing to win convictions. After three officers were acquitted, prosecutors dropped the charges against the remaining officers awaiting trials.

In response to the Justice report in August, the police department has begun to make changes, including the use of new equipment such as body cameras for officers and increased funding for community relations, particularly regarding young people.

Among the consent decree’s changes for the department of about 2,600 officers is new training to ensure that police use de-escalation techniques and attempt to resolve conflicts without force. In addition, the department has agreed to adopt an approach to policing that is “community-oriented and based on problem-solving principles.”

According to the agreement, the department will ensure that people in custody are safely transported by police and that protesters are treated with respect. The department agrees to thoroughly investigate allegations of sexual assault and officer misconduct.

The deal also establishes a Community Oversight Task Force to make recommendations for changes to the current system of civilian oversight.

Once approved by the court, city officials and the Justice Department will recommend an independent monitor. That person will oversee implementation of the agreement, which will remain in place until the department has fully complied.

City officials did not detail the cost of enacting such changes, but the agreement limits the annual amount the city will pay to the monitor to about $1.5 million.

Maryland Gov. Larry Hogan (R) suggested Thursday that he would consider providing state funds to help implement the plan.

“The city has no idea at this point what costs might be involved to implement it, but we’re going to sit down and see how the state might be able to provide assistance,” he said at a news conference in Annapolis.

In a statement Thursday, the head of the Baltimore police union said its representatives had been left out of the negotiations.

“Neither our rank and file members who will be the most affected, nor our attorneys, have had a chance to read the final product,” according to the Baltimore City Fraternal Order of Police, Lodge No. 3.

Vanita Gupta, the head of Justice’s civil rights division, noted in her remarks that the parties will ask the court to hold a public hearing on the agreement to give the community an opportunity to comment.

Members of Maryland’s congressional delegation said in a joint statement that they hope the agreement will be a “road map for reform” for the police department.

Baltimore State’s Attorney Marilyn Mosby, who prosecuted the officers in the Gray case, called it a “step in the right direction toward the necessary reforms to ensure accountability, transparency, and trust among our communities and law enforcement.”

Matt Zapotosky and Josh Hicks contributed to this report.