SALT LAKE CITY — A federal judge has overturned a key part of a Utah law that aimed to protect children from harmful online material.

U.S. District Judge Dee Benson's order expressly forbids any prosecution under the law, except when somebody sends inappropriate images or language directly to a child through email, text or instant messaging.

The Utah law sought to make website operators or content providers liable for any material that the state deems harmful to minors.

The judge says Utah must pay the legal fees of ACLU of Utah and other groups that challenged the law.