A federal judge has struck down as unconstitutional a 2012 Iowa law that banned undercover recording at agricultural production facilities in the state, saying the law’s primary aim is curbing speech critical of practices at those facilities.

“When the state seeks to regulate protected speech, it bears the heavy burden of showing that the prohibition satisfies constitutional scrutiny,” Senior Judge James Gritzner, of Iowa’s Southern District, wrote in a ruling he handed down Wednesday, Jan. 9. “Defendants have not met their burden.”

Iowa’s law prohibited anyone from working undercover at an agricultural production facility to record how animals are treated or crops are treated or modified. Supporters of the law said it was needed to keep activists from trespassing on private property and to protect facilities from potential health risks outsiders could bring with them.

Critics said it kept activists, reporters and other citizens who wanted to expose unhealthy conditions for animals from learning about those conditions and reporting them.

The Animal Legal Defense Fund; Iowa Citizens for Community Improvement, which acts as a watchdog on factory farms; Bailing Out Benji, a nonprofit organization for dog and puppy protection; People for the Ethical Treatment of Animals (PETA); and the Center for Food Safety sued in a petition filed by ACLU Iowa.

The Iowa Center for Public Affairs Journalism, which runs IowaWatch, joined the Iowa Freedom of Information Council in an amicus curiae, or friend of the court, filing supporting the lawsuit, saying the law restricted newsgathering by journalists. IowaWatch has done reporting on dog breeding facilities that violate animal health laws.

“Undercover investigations have been a long part of journalism in the United States and I’m grateful to see the court recognize that,” Randy Evans, executive director of the Iowa Freedom of Information Council, said at a Des Moines news conference.

Defendants were Gov. Kim Reynolds, Attorney General Tom Miller and Montgomery County Attorney Bruce Swanson. Former Gov. Terry Branstad signed the law after the Iowa Legislature passed it.

Gritzner’s ruling granted the plaintiffs’ request for summary judgment in their favor and against the defendants’ request for judgment in their favor.

Gritzner said in his ruling that Iowa’s law, in effect, implicates First Amendment rights because you could not break the law without engaging in speech. He said the law effectively criminalized undercover investigations of certain agricultural facilities, like puppy mills. And, he wrote, the law was similar, and in parts identical, to laws in other states that regulate conduct and speech about agricultural operations.

“In fact, Iowa is one of many states that have passed or attempted to pass such legislation in the last decade,” Gritzner wrote. “Of those in effect, several have been invalidated or limited based on First Amendment challenges.”

Gritzner wrote that the state had shown no evidence that the law’s prohibitions would protect perceived harm to the ag facilities or biosecurity.

He cited incidences of lawmakers saying they wanted to curb activists from spreading damaging or false information about the facilities and agriculture production practices.

“Plaintiffs and their amici – the Freedom of Information Council and Iowa Center for Public Affairs Journalism – frame this legislative trend within the context of an on-going tension between members of the news media and the agriculture industry,” he wrote.

The Freedom of Information Council and Iowa Center for Public Affairs Journalism brief in support of the lawsuit stated that the public wants consumer news about the food they eat and how it is produced, but that the Iowa law hampered reporting unflattering news.

Under the law, a first conviction would be a serious misdemeanor while a second conviction would be an aggravated misdemeanor.

“This is an important victory for free speech in Iowa,” Rita Bettis Austen, the ACLU Iowa lead attorney in the case, said at the Des Moines news conference, which ACLU Iowa showed via Facebook Live. “These laws, which penalize investigative reporting on agricultural facilities, have proliferated in the last decade across the country, not just here in Iowa.”

Bettis Austen said, “The ag-gag law was clearly a violation of Iowans’ First Amendment rights to free speech and it silenced advocates and ensured that animal cruelty, unsafe food safety practices, environmental hazards and inhumane working conditions went unreported for years.”

Bailing Out Benji executive director Mindi Callison said the ruling was groundbreaking. “Because of it, hopefully other states are able to overturn their ag-gag laws,” Callison said.

The Associated Press reported that the Iowa Attorney General’s Office is considering an appeal. The AP also reported an Iowa Pork Producers Association statement on the ruling: “Iowa pig farmers will continue to properly care for their animals and provide safe and secure working conditions for their employees. And, they will fight those who try to destroy or attack their livelihoods one case at a time.”

Federal courts also have struck similar laws in Idaho, Utah and, late last year, Wyoming, and a case challenging a restrictive law in North Carolina is pending.