WASHINGTON (AP) _ The Supreme Court ruled Wednesday that states may put pictures of convicted sex offenders on the Internet without unconstitutionally punishing them twice, a victory for states that use the Web to warn of potential predators in neighborhoods.

In a separate ruling, the court turned back a challenge from offenders who argued they deserved a chance to prove they aren't dangerous to avoid having their picture and address put on the Internet.

The decisions came in the Supreme Court's first review of what are known as Megan's laws _ and have far-reaching implications because every state and the federal government have sex-offender registry laws.

The laws are named for 7-year-old Megan Kanka, a New Jersey girl kidnapped, raped and killed in 1994 by a convicted sex criminal who lived in her neighborhood.

The cases, from Alaska and Connecticut, required justices to balance the rights of offenders with the public safety interest in keeping tabs on people who may commit more sex crimes. The court came down on the side of public safety.

Justices rejected arguments of two Alaska sex offenders who contended that they already served time for sex crimes before the Alaska registration law was passed and were punished a second time with the registry. The law requires convicts to give police personal information four times a year or risk more prison time.

Justice Anthony Kennedy, writing for six justices, said that the law is not punitive, and therefore it does not punish the inmates after the fact.

``Our system does not treat dissemination of truthful information in furtherance of a legitimate governmental objection as punishment,'' he wrote. ``The purpose and the principal effect of notification are to inform the public for its own safety, not to humiliate the offender.''