HARRISBURG, Pa. (AP) – The Pennsylvania Supreme Court has upheld laws that requires sex offenders deemed “sexually violent predators” to undergo lifetime counseling and registration and be the subject of community notices.

The court said in Thursday’s ruling that the requirements have the legitimate purpose of keeping the community safe and therefore don’t amount to punishment.

The Butler County case is one of several under review in Pennsylvania that challenge the constitutionality of sex offender registries amid concerns about harassment, ostracism and unfair punishment.

Actor Bill Cosby has raised the issue in appeals of his 2018 sex assault conviction and three- to 10-year prison term.

(Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.)