SALT LAKE CITY (AP) — A federal judge is weighing whether a Utah ban on hidden cameras at slaughterhouses that was passed amid a wave of similar measures around the country violates the right to freedom of speech.

U.S. District Judge Robert Shelby heard arguments Tuesday in a challenge to a state law that bans secret filming at agricultural facilities. A similar measure was struck down last year in Idaho. Animal activists argue the law is an unconstitutional attempt to keep them from exposing inhumane or unsafe practices at factory farms.

The state of Utah contends the First Amendment doesn't allow people to enter private property under false pretenses and record however they want. Shelby questioned both sides closely, saying he's spent hours weighing the issues raised by the case. He did not immediately rule.