MEMPHIS, Tenn. (CN) – A federal judge in Memphis ruled Friday that the city’s failure to properly train members of its police department caused it to violate a 1978 agreement not to collect political intelligence on activists exercising their First Amendment rights.

“The failure was one of training and inadequate direction over a sustained period of time,” Senior U.S. District Judge Jon McCalla wrote in a 39-page opinion.

The American Civil Liberties Union of Tennessee, which brought the lawsuit against the city, hailed the decision as a “tremendous victory for free speech” because residents of Memphis enjoy greater protections that what is guaranteed by the First Amendment due to a 1978 consent decree.

“This uniquely positions Memphis to be a standard-bearer for cities across the country as they wrestle with how to protect individuals’ privacy and free speech in the face of ever-growing surveillance technologies,” Thomas Castelli, legal director for the ACLU of Tennessee, said in a statement.

In his opinion, Judge McCalla said the city violated its consent agreement when it used its real-time crime center to search several social media sites for posts relating to the Black Lives Matter movement “because the information gathered related to First Amendment rights.”

Memphis collected information on non-criminal activity and distributed it through intelligence briefs to other law enforcement organizations and individuals in companies such as FedEx and St. Jude.

In one example, the Memphis Police Department used Facebook under an alias account named “Bob Smith,” which friended activists and joined groups associated with the Black Lives Matter movement in order to monitor them. It also identified three Memphis-based journalists and gathered information on them because of the sources they developed in the movement.

In September 1978, Memphis entered into a consent decree with the ACLU after the city burned its political intelligence files gathered on Vietnam War protesters instead of handing them over.

The agreement barred Memphis from investigating people because of their First Amendment activity. For example, it specifically prevents the city from infiltrating groups exercising free-speech rights or recording names, photographs and license plates of people attending meetings and demonstrations.

The ACLU filed suit last year, asking the court to find the city in contempt of the consent decree after a list surfaced of people that required a police escort while visiting Memphis City Hall, some of whom had no criminal record but were involved with Black Lives Matter.

The original 1970s court case was a major win for the ACLU of Tennessee. Speaking from the witness stand during the first day of the bench trial on Aug. 20, Executive Director Hedy Weinberg said the two most significant cases the organization ever took on were political intelligence in Memphis and the infamous Scopes Monkey Trial.

In Friday’s ruling, McCalla disagreed with the ACLU’s allegation that the city discriminated against people seeking public-assembly permits and harassed individuals. The judge also noted the fault in violating the consent decree did not rest on the police officers themselves.

However, McCalla ordered Memphis to revise its regulations and social media guidelines to define “political intelligence” so it better conforms to the consent decree, and design training with the changes in mind.

“MPD officers did not understand that the consent decree provided a specific definition of ‘political intelligence,’ because the city failed to tell them,” the ruling states. “Even simple, selective training given to [certain] units may have completely prevented all violations in this case.”

The judge ordered the city to submit a list of the searches it performed on its social media collators every three months. The court will appoint an independent monitor to observe the implementation to the court’s orders, whom the city will pay for.

McCalla also awarded the ACLU of Tennessee attorney’s fees.

In a statement sent by city spokeswoman Ursula Madden, Memphis said it took steps to follow the decree before the August trial began.

“MPD now has a strict protocol for initiating an investigation that would require an officer to monitor social media platforms—and did so, well before this ruling,” the city said. “The court believes that we can do better, and we agree.”

The Rev. Ashton Alexander said he always had an inclination that the Memphis Police Department was monitoring members of Black Lives Matter as they held monthly meetings at his church, nothing that squad cars were often parked outside the building.

Memphis police named his Pilgrim Rest Baptist Church in its intelligence briefings, a fact Alexander learned just before the trial began in August.

Alexander said he opened his building up to the meetings because he wanted to show that Black Lives Matter’s concerns of justice and equality were not antithetical to the concerns of his congregation.

“I thought [the surveillance] was downright sinful because this is a meeting that is supposed to promote social change,” Alexander told Courthouse News in August. “Nobody at the meeting was conspiring to do anything that was criminal.”

He added, “I think this is a good example of the state expanding what its role should be.”

Independent journalist Wendi Thomas learned that the Memphis Police Department’s undercover Facebook account “Bob Smith” was monitoring her as she sat in the gallery listening to the first day of the trial.

“Because of the things I write and because, frankly, of the reaction I’ve gotten over the years from some white people, white leaders, I have always assumed the police were watching me,” Thomas told Courthouse News at the time.

Still, after the shock wore off, it made the 2016 Nieman Foundation for Journalism fellow and editor and publisher of MLK50 furious.

Over the years, Thomas has received death and rape threats, such as when she wrote about Memphis’ now-removed statue of Ku Klux Klan founder Nathan Bedford Forrest, and she said she felt the police never took the threats seriously. She now takes precautions, such as taking different routes to and from her home.

As a local, Thomas hears the police department’s plea that they “desperately need more feet on the street,” and so she said she finds its monitoring of nonviolent individuals “mind-boggling.”

Memphis has moved to vacate the consent decree, and Judge McCalla noted the court will issue a separate ruling on that.

The judge agreed technology changed drastically since 1978 and it will continue to change in the future. Today, Memphis has recorded and stores “terabytes of video footage” and McCalla admitted that storing that information is probably not investigative in nature, making that portion of consent decree outdated.

Across the country, law enforcement uses technology such as facial recognition and StingRay cellphone tracking, McCalla noted.

“While certain terms of the consent decree may be outdated, the concepts are not, and the dilemma faced by the city is not new,” McCalla wrote. “Every community must determine how much of its citizens’ privacy it is willing to sacrifice in the name of public safety. The idea that police should be limited in their powers predates 2018 and 1978.”

But by conforming to its decade-old consent decree, McCalla said Memphis is carrying out what few cities in the nation have done: creating a policy that protects privacy in the age of algorithms, cameras, social media and artificial intelligence.

“The court recognizes this may be a heavy burden; being a pioneer usually is,” he wrote.