The Alaska Supreme Court ruled that a state law requiring the registry of all sex offenders is unconstitutional because it violates offenders' rights to due process. The ruling was issued Friday.

In a 3-2 decision, the court said an offender must be given the chance to prove he or she is rehabilitated and no longer remains a threat to the public.

“Our decision requiring an individualized risk-assessment hearing is based on the judicial power,” the court wrote in its opinion. If an offender "can show at a hearing that he does not pose a risk requiring registration, then there is no compelling reason requiring him to register, and the fact that ASORA does not provide for such a hearing means that the statute is unnecessarily broad.”

JEFFREY EPSTEIN, REGISTERED SEX OFFENDER, SETTLES CIVIL LAWSUIT AND AVOIDS TESTIMONY FROM ALLEGED VICTIMS

The court, however, upheld a lower court ruling mandating the registration of sex offenders upon moving to Alaska if they were required to register in another state as well.

The Alaska Sex Offender Registry Act requires sex offenders to register with law enforcement 30 days before being released from jail or prison or within a day of a conviction where the sentence doesn't include jail time.

The ruling stems from a 2016 case involving an unnamed man convicted in 2000 of sexual battery in Virginia. He was sentenced to five years in prison -- the time was suspended -- and five years' probation and was required to register as a sex offender.

CLICK HERE TO GET THE FOX NEWS APP

Upon moving to Alaska, he registered as a sex offender annually for several years and then stopped. He sued the state, claiming the sex offender registry law violated his rights to due process.