A federal judge in Alexandria struck down as unconstitutional yesterday a new Virginia law banning the display of sexually explicit material, saying the statute was overly broad and would force many classics and best sellers to be placed behind counters or into "adults only" areas.

U.S. District Judge Richard L. Williams permanently enjoined police from enforcing the two-month-old law, designed to require the shielding of materials "harmful to juveniles," even if not obscene. He said the law violates the First Amendment's free press guarantees and would effectively "stifle an adult's access to communications he or she is entitled to receive."

The law, sponsored by a Northern Virginia legislator, was supposed to force newsstands to hide from view the covers of sexually explicit magazines such as Playboy, Penthouse and Hustler.

But Williams held that the state did not have the power to regulate what could be displayed on bookshelves.

"The level of discourse reaching commercial bookshelves cannot be limited to what might be appropriate for an elementary school library," the judge said in a 17-page opinion.

A coalition of local and national booksellers and publishers had challenged the law as unconstitutional, arguing that it would require them to remove from their shelves many classics, books for teen-agers and best sellers by such authors as Sidney Sheldon, Judith Krantz and Harold Robbins.

The judge agreed. "Due to the wide sweep of the statute, a number of classic literary works, romances and best sellers would have to be placed behind the counter or into monitored 'adults only' areas," he wrote.

Williams said that "the average general bookstore in the Northern Virginia area carries a signficant percentage of materials (varying between 5-25 percent) that are 'harmful to juveniles' as defined in the statute."

"I'm real, real happy and real, real relieved," said Carol Johnson, owner of Books Unlimited Inc. in Arlington, who was among those who challenged the law.

A spokesman for state Attorney General William Broaddus, whose staff had defended the law, said the ruling probably will be appealed to the 4th U.S. Circuit Court of Appeals. "Our position is this law was a reasonable attempt to protect juveniles from sexually explicit materials while not infringing on the rights of adults," the spokesman said.

State Del. Vincent F. Callahan Jr. (R-Fairfax), who sponsored the bill, said he acted after a similar county law was struck down by the courts on the grounds that the Fairfax County Board did not have authority to enact the law. County officials asked him to introduce the measure Williams struck down and "it passed without comment," Callahan said.

"I am very, very shocked at what Judge Williams has done," said Richard J. Enrico, founder of a Northern Virginia group called Citizens Against Pornography that lobbied for the law. "I'm just wondering if Judge Williams is aware of what's in those books."

The judge apparently rejected arguments such as Enrico's in favor of the booksellers' statements that the First Amendment rights should prevail. "The state's purpose . . . however praiseworthy, cannot be pursued by means which effectively stifle an adult's access to communications he or she is entitled to receive," the judge said.

In their complaint, the book vendors said that they had no "commercially viable" way of complying with the Virginia law. It would require them to remove the offending books from their shelves or rope off certain sections of their shops to those under 18 or refuse entry to juveniles, they said, steps that would be difficult and hinder sales.

In addition, Johnson said the broad wording of the law would prevent her from displaying any book or periodical that contains a description or picture of sexual conduct or nudity.