A federal judge ruled that a Virginia law intended to restrict internet material considered harmful to children is unconstitutional.

U.S. District Judge James H. Michael Jr.’s opinion prevents the state from enforcing a 1999 law subjecting web site operators to criminal prosecution if they knowingly allow minors access to sexually explicit material on their sites. Virginia is the fourth state in which judges have struck down such laws.

Businesses argued that the law violates free speech by limiting what adults can say in internet chat rooms and eMails and what they can post on web sites. It also unconstitutionally subjects out-of-state web site operators to Virginia laws without the operators even knowing, they argued.

Lawyers for the state countered that the law protects web site operators who take reasonable steps to keep minors from the material, such as requiring credit card numbers and personal information.

Michael acknowledged the state’s interest in “helping parents to protect minors from sexually explicit materials,” but the judge determined that Virginia lawmakers had not made the law specific enough to protect the freedoms of adults.

A spokesman for the attorney general’s office said the state would appeal.