BOISE, Idaho (AP) — A federal judge has ordered Idaho to pay roughly a quarter million dollars in legal fees to the Animal Legal Defense Fund and other groups who successfully sued the state over what they called the "ag-gag" law.

Idaho lawmakers passed the law making it a crime to surreptitiously videotape agriculture operations in 2014 after the state's $2.5 billion dairy industry complained that videos of cows being abused at a southern Idaho dairy unfairly hurt their businesses.

The Animal Legal Defense Fund sued the state, and in 2015 a federal court invalidated the law after finding that it violated the First Amendment.

On Wednesday, U.S. District Judge B. Lynn Winmill ordered the state to pay the winning side roughly $250,000 to cover their attorney fees and costs.