A recent court ruling will allow whistleblowers to continue to expose horrific conditions for animals at Iowa’s factory farms without automatically facing criminal penalties.

In recent years, the number of proposed laws aimed at enabling agricultural entities to operate with impunity have been coined as “Ag-gag” laws. As the name implies, the proposed laws seek to “gag” would-be whistleblowers and undercover activists by punishing them for recording footage of what goes on in animal agriculture, according to a definition from the Animal Legal Defense Fund (ALDF).

In Iowa, a 2019 law, known as “Ag Gag 2.0,” tried to criminalize attempts by animal advocates to gain access — including via employment under false pretenses — to agricultural facilities where animal cruelty is commonplace and document their findings, according to news reports.  Iowa lawmakers created a trespass charge punishable by up to a year in jail for investigators who might cause “economic harm” to livestock facilities.

In response, the state was sued by a number of animal welfare nonprofits, including ALDF, People for the Ethical Treatment of Animals, the Center for Food Safety, Iowa Citizens for Community Improvement and Bailing Out Benji.

Recently, a judge for the U.S. District Court for the Southern District of Iowa ruled that the law criminalizing undercover investigations — including at factory farms, slaughterhouses, and puppy mills — violates the First Amendment.

That decision was applauded by many, including the American Civil Liberties Union-Iowa.

“The Ag Gag 2.0 law aims to silence critics of worker rights abuses, animal cruelty, unsafe food safety practices, and environmental hazards in agricultural facilities,” the ACLU maintained.

Judge Stephanie Rose, who struck down the law as unconstitutional, also noted that the groups that sued the state wanted to expose issues of public concern, such as animal abuse, food safety and agricultural working conditions.

“The state of Iowa may not single out individuals for special punishment based on their critical viewpoint of agricultural practices, which they have sought to do,” Rose wrote regarding her decision.

Free speech rights guaranteed by the First Amendment are a central part of the legal wrangling over Ag Gag laws, four of which have been passed in Iowa since 2012. All but one of those laws are tied up in federal court on constitutional grounds, the Des Moines Register reported.

Similar Ag Gag laws have been struck down in Kansas, Utah and Wyoming, and federal courts have rejected some legal provisions in Idaho, according to ABC News. Lawsuits challenging attempts to quell animal abuse investigations are currently pending in Arkansas, North Carolina and Iowa.