The law was challenged by civil rights groups and websites

The law made it illegal for websites to provide children access to "harmful" material, but it was never enforced.

Judge Lowell Reed of Philadelphia said other means of protection, such as software filters, were more effective.

Opponents criticised the ruling, saying parents should not have to shoulder the burden of restricting adult material.

'Unconstitutional'

Judge Reed said that while he sympathised with the need to protect minors, the 1998 Child Online Protection Act was problematic.

It is not reasonable for the government to expect all parents to shoulder the burden to cut off every possible source of adult content for their children

Peter D Keisler

Government lawyer

Send us your comments

"I may not turn a blind eye to the law... to protect this nation's youth by upholding a flawed statute, especially when a more effective and less restrictive alternative is readily available," he wrote.

The act was challenged by civil liberties groups and sexual health and other websites, including the online magazine salon.com, which claimed it was too restrictive and unconstitutional.

The legislation would have fined commercial websites up to $50,000 (£25,500; 37,500 euros) and sentenced offenders to up to six months in prison.

"This law is not really aimed at commercial pornography, but really reaches far beyond that to a broad range of valuable content," John Morris, of the Center for Democracy and Technology, told reporters.

But government lawyers criticised the outcome, saying software filters were not so effective.

"It is not reasonable for the government to expect all parents to shoulder the burden to cut off every possible source of adult content for their children, rather than the government's addressing the problem at its source," government lawyer Peter D Keisler wrote following the four-week hearing, the Associated Press news agency reported.

The law was never enforced because it was immediately challenged when it was passed and subject to a temporary injunction in 2004 on the grounds that it was likely to be struck down.