Eric Martin and René Pérez are civil rights activists with a very specific passion: They record the police. When Martin and Pérez see law enforcement officers performing their duties, they take out their phones to capture the scene on camera, ready to film any misconduct that might occur. Officers sometimes retaliate—Pérez says they have even grabbed his phone—so both would like to film in secret. But they have a problem: Massachusetts’ wiretap law prohibits the covert recording of anyone, even government officials doing their jobs in public. Violators can be imprisoned for up to five years.

But on Monday, U.S. District Judge Patti B. Saris blocked the wiretap law’s application to the secret filming of police in public, ruling that it infringes upon freedom of expression. Her ruling is an important step forward for the First Amendment “right to record,” which has become increasingly valuable—and hotly contested—at a time when images of police brutality often go viral.

Massachusetts has a dark history of punishing civilians who dare to record cops. In 2007, police arrested Simon Glik for filming officers as they punched a man on Boston Common. Prosecutors charged Glik under the wiretap law, known as Section 99, though a trial court dismissed the charges. Aided by the American Civil Liberties Union of Massachusetts, Glik then filed a lawsuit against the police department, alleging a violation of his civil rights. In 2011’s Glik v. Cunniffe, the 1st U.S. Circuit Court of Appeals found that the officers had, indeed, infringed on Glik’s freedom of speech. It expressly affirmed the right to record, noting that the First Amendment bars the government “from limiting the stock of information from which members of the public may draw.”

The police department eventually admitted it was wrong and settled the lawsuit for $170,000. Yet Massachusetts police continued to suppress recordings, arguing that the First Amendment did not protect the secret filming of law enforcement. In 2012, the Shrewsbury Police Department charged Irving Espinosa-Rodriguez under Section 99 for teaching a passenger how to covertly record his interaction with an officer during a traffic stop. In 2014, the Chicopee Police Department charged Karen Dziewit under Section 99 for secretly filming police officers as they arrested her. In 2015, the Hardwick Police Department charged Destiny McKeon as an accessory to illegal wiretapping because she knew about another person’s secret recording of a traffic stop and did not alert the officers.

This pattern of persecution is deeply disturbing. Although the Supreme Court has never specifically discussed the right to record, the 1st, 3rd, 5th, 7th, 9th, and 11th U.S. Circuit Courts of Appeals have all held that the First Amendment plainly protects the filming of officers and public. And for good reason: A long line of Supreme Court precedents confirms that the government may not “repress speech by silencing certain voices at any of the various points in the speech process.” As the 7th Circuit explained, the “act of making” a recording is “a corollary of the right to disseminate the resulting recording.” The “right to publish or broadcast” the recording “would be insecure, or largely ineffective” if the recording itself were banned. Nobody seriously argues that the government could forbid us from taking notes in public to detail police officers’ behavior. Why should it be permitted to ban audiovisual recordings—whether covert or conspicuous?

Massachusetts, however, has refused to modernize Section 99 to comply with these legal developments. (It has also been slow to roll out body cameras for cops, which would theoretically create continuous video of their public activities.) So, in 2016, the ACLU of Massachusetts sued again, this time on behalf of Martin and Pérez. It argued that police were working around the landmark Glik decision by targeting secret recordings, when the Glik court made no distinction between open and furtive filmings.

The evidence is undeniable: Massachusetts officers don’t just continue to arrest individuals who record them. The Boston Police Department’s official training material actually instructs officers that they may arrest and charge people who secretly record them performing their duties in public. The Boston Police Academy even issued a training bulletin informing officers that they can arrest individuals who surreptitiously record them doing their job. It also put out a training video that instructs officers they can “take charges out against” an individual who secretly records them.

Judge Saris disagreed. As a content-neutral restriction on conduct protected by the First Amendment, she wrote, Section 99 must be “narrowly tailored to serve a significant government interest” to pass constitutional muster. It is not. The “diminished privacy interests of government officials performing their duties in public,” Saris held, “must be balanced by the First Amendment interest in newsgathering and information-dissemination.” Here, the First Amendment wins out: Section 99 is not narrowly tailored to protect privacy, but is rather a blunt instrument that officers can exploit to suppress expression. The Constitution does not permit public officials to limit “the stock of public information” in this way.

The Boston Police Department’s official training material actually instructs officers that they may arrest and charge people who secretly record them performing their duties in public.

Oddly enough, Saris’ decision consolidated the Massachusetts ACLU’s case with a similar lawsuit—one brought by Project Veritas, James O’Keefe’s undercover troll operation. While the ACLU and Project Veritas didn’t work together closely, their suits took aim at the same statute. Unlike the ACLU’s plaintiffs, who wish to capture potential police misconduct, O’Keefe wants to film progressive public officials, then release heavily edited videos falsely implying that they broke the law. The cause may be less noble, but the First Amendment protects the act of filming these officials all the same.

Thanks to the ubiquity of smartphones and the vigilance of courageous bystanders, police brutality and misconduct are increasingly difficult to cover up. The killings of Eric Garner and Walter Scott are lodged in the public consciousness, vivid reminders of the cruelty, racism, and injustice that still infects American policing. Saris’ decision ensures that Massachusetts cops can’t invoke Section 99 to censor secret videos of their work. Martin and Pérez—and, yes, even O’Keefe—can finally record Massachusetts’ public officials clandestinely without fearing their films will land them in prison.