WASHINGTON (AP) – The police response to unrest in Ferguson, Missouri, last summer offers lessons in how not to handle mass demonstrations, according to a Justice Department report that warns such problems could happen in other places roiled by mistrust between law enforcement and the community.

The report fleshes out a draft version made public in June, creating a portrait of poor community-police relations, ineffective communication among the more than 50 law enforcement agencies that responded, police orders that infringed on First Amendment rights, and military-style tactics that antagonized demonstrators.

The final version, which is to be released on Thursday, was obtained in advance by The Associated Press.

The report focuses on the regional police response in the 17 days that followed the Aug. 9, 2014, shooting of Michael Brown, an unarmed black 18-year-old, by a white police officer. In a detailed chronology, it tracks missteps that began almost immediately after the shooting when police wrongly assumed that crowds would quickly dissipate and failed to grasp community angst over the hours-long presence of Brown’s body beneath white sheets in the street.

It details more flaws over the next two weeks, including the improper use of police dogs, armored vehicles and snipers to monitor crowds; the decision by some officers to remove their nameplates; arbitrary orders to demonstrators to keep moving after five seconds; and poor communication among agencies that led to confusion about which policy to follow and who was in charge. Even as rumors spread, police failed to use social media to distribute correct information that could have eased concerns, according to the report.

Several law enforcement agencies whose actions were studied said they’ve learned from the events.

Police officers interviewed for the review complained of inconsistent orders from commanders, with some saying “there was no plan in place for arresting people” or that they “were unclear who they could arrest.” Community members, meanwhile, described poor relationships with the police that predated, and were made worse by, the shooting.

“Having effective relations and communications with the community, recognizing that endemic problems were at the base of the demonstrations, and understanding how the character of the mass gatherings was evolving and spreading beyond the initial officer-involved shooting would have all aided in incident management decisions,” the report states.

It also makes clear that the factors that created the unrest in Ferguson are not unique to the city, particularly in a year of heightened tensions between police and minority communities nationwide.

The Justice Department cautioned that while the public sees the St. Louis suburb “as a community of division and violence,” the protests and unrest that occurred there could happen in other places “in which fostering positive police-community relationships and building trust are not a priority.” Federal officials hope the report will be instructive to other police departments confronting mass demonstrations.

“In many ways, the demonstrations that followed the shooting death of Michael Brown were more than a moment of discord in one small community; they have become part of a national movement to reform our criminal justice system and represent a new civil rights movement,” Ronald Davis, director of the Justice Department’s Community Oriented Policing Services office, wrote in an introduction.

The Ferguson shooting, along with other deaths of blacks at the hands of white police officers, sparked a national dialogue about police-community relations and the role of race in policing. Several recent fatal shootings of officers, including in Illinois and Texas, have focused attention on violent crime and officer safety.

“We have seen violence strike at all segments of our community,” Attorney General Loretta Lynch said at a housing conference Wednesday. “It is a sad fact now that no one is safe.”

The Justice Department announced a review of the regional police response in September 2014 following a request from the St. Louis County police chief. The review is separate from a Justice Department report in March that criticized Ferguson police practices and the city’s profit-driven municipal court system. A grand jury and the Justice Department both declined to prosecute Darren Wilson, the white officer who shot Brown and later resigned.

The report focuses in particular on the responses of police in Ferguson, St. Louis city and county and the Missouri Highway Patrol.

A representative of the city of Ferguson said Wednesday that officials had not yet seen the report. The Missouri Highway Patrol said it’s implemented “lessons learned from its own review.”

A spokeswoman for the St. Louis city police department, Schron Jackson, said the agency had made multiple changes since last summer, including hiring more minority officers and launching a community engagement division.

“What our officers encountered during those first 17 days of unrest has forever changed policing,” Jackson said. “We acknowledge such change by the progressive steps our department has taken to build better community relationships.”

St. Louis County Police Chief Jon Belmar said demonstrations like the ones that occurred in Ferguson are “unwieldy and difficult to manage by any precise measure” and that law enforcement could learn from “our successes and lessons learned.”

But he said the report provided only a limited snapshot, ignoring more recent police responses seen as improvements, such as during the one-year anniversary of Brown’s shooting.