WASHINGTON — The Justice Department will conduct a broad investigation into the Baltimore police force to identify law enforcement practices that are unconstitutional and violate civil rights, Attorney General Loretta Lynch said Friday.

Lynch visited the city and met with city and community leaders earlier this week, in the aftermath of riots and unrest. Her announcement fulfills a request from Baltimore Mayor Stephanie Rawlings-Blake, who initially appeared determined to fix the city’s problems on her own, but then requested a Justice Department investigation.

Soured relations between the police and the communities they serve is “one of the most challenging issues of our time,” Lynch said in announcing the investigation, adding that there has been “a serious erosion of public trust.”

The investigation, similar to ones undertaken in cities across the country such as Ferguson, Missouri, and Cleveland, Ohio, will look for trends of unconstitutional policing practices within the city, such as patterns in the use of deadly force or improper stops and searches.

Federal authorities already were conducting a second, separate investigation into the death of Freddie Gray, a black man who died last month after suffering grave injuries while in police custody. The death set off chaos in the city, and Baltimore’s top prosecutor has brought charges against six police officers.

“Ultimately, this process is meant to ensure that officers are being provided with the tools they need — including training, policy guidance and equipment — to be more effective, to partner with civilians, and to strengthen public safety,” Lynch said.

Baltimore officials last fall began participating in a voluntary and collaborative Justice Department review. But some officials, including in Congress, were skeptical that such a review could result in needed changes and asked for a broader civil rights investigation.

Baltimore suffered days of unrest after Gray died April 19 following a week in a coma after his arrest. Protesters threw bottles and bricks at police the night of his funeral on April 27, injuring nearly 100 officers. More than 200 people were arrested as cars and businesses burned.

The Justice Department has undertaken several dozen similar investigations since being granted the authority do so by Congress in 1994. In some cases, such as in Ferguson, the federal government initiated the process on its own; in others, including Albuquerque’s, city officials made the request.

Baltimore City Council President Jack Young called the decision “a watershed moment” for the city.

Young had been pushing for such an investigation. He said that a voluntary, collaborative civil-rights review the city and Justice Department launched in October lacked tough enforcement provisions.

“I am reminded of the many men and women, young and old, who have suffered injustice at the hands of a minority of persistently rogue officers over many generations. This federal civil rights probe should serve as a stepping-stone toward justice for them and their families,” Young said in a statement.