BOISE, Idaho (AP) — An animal welfare group on Tuesday applauded a court ruling ordering the state of Idaho to pay $260,000 to attorneys for animal rights groups after federal courts said the state's law banning spying at farms, dairies and slaughterhouses violated free speech rights.

"We hope this award sends a strong message that Ag-Gag laws, which are designed to insulate factory farms from public scrutiny, are not only bad policy but illegal as well," said John Seber of Mercy for Animals in a statement to The Associated Press.

U.S. District Court Chief Judge B. Lynn Winmill issued the order Friday as part of a settlement between Idaho Attorney General Lawrence Wasden and the Animal Legal Defense Fund and others.

The attorney general's office declined comment.

The dairy industry pressed for the law after Los Angeles-based Mercy For Animals in 2012 released videos that showed workers at Bettencourt Dairy in southern Idaho beating and stomping cows, and using a tractor to drag a cow by a chain attached to her neck.

Idaho lawmakers in 2014 passed the law making it a crime to surreptitiously videotape agriculture operations after the state's $2.5 billion dairy industry complained that the videos made public by Mercy For Animals unfairly hurt their businesses.

The measure passed easily in Idaho, where agriculture is not only one of the leading businesses but also the occupation of many state lawmakers. People caught surreptitiously filming Idaho agricultural operations faced up to a year in jail and a $5,000 fine. Animal welfare groups, civil rights groups and media organizations sued.

Winmill in late 2015 blocked the law as an unconstitutional infringement of the First Amendment of the U.S. Constitution safeguarding free speech, the first time such a law had been struck down.

The Ninth U.S. Circuit Court of Appeals rejected Idaho's appeal.

U.S. Circuit Judge M. Margaret McKeown wrote that the law "criminalized innocent behavior, was staggeringly overbroad, and that the purpose of the statute was, in large part, targeted at speech and investigative journalists." But the panel also ruled Idaho's law correctly criminalized those who made false statements to either obtain records at an agricultural facility or to obtain employment with the intent to inflict harm.

More From News Radio 1310 KLIX