The Alaska Supreme Court has ruled that the state’s sex offender registry law violates offenders’ right to due process.

In an opinion handed down Friday, the court — voting 3-2 — found the law requiring all offenders to register unconstitutional, unless offenders are first given the opportunity to demonstrate they aren’t a danger to the public.

The Alaska Sex Offender Registration Act requires anyone convicted of a sex offense or child kidnapping to register personal information, including their place of employment and residential address, into a statewide public database. Sex offenders convicted after Jan. 1, 1999, are required to register quarterly.

An unnamed sex offender referred to in the opinion as “John Doe” sued the Department of Public Safety over the registry in 2016, arguing the law violates the state constitution’s due process clause, as well as Doe’s right to privacy, among other rights.

Doe, who moved to Alaska three years after being convicted of aggravated sexual battery in Virginia in 2000, also argued that the state didn’t have legal jurisdiction to make him register because his crime was committed in a different state.

While the court ruled that the state does, in fact, have the right to require out-of-state offenders to register, it found the registry law too sweeping, penalizing rehabilitated sex offenders without offering them any relief from the registry’s consequences.

“ASORA is overbroad because it imposes its requirements on all persons convicted of designated offenses without affording them a hearing at which they might show that they are not dangerous," Senior Justice Warren Matthews wrote in the majority opinion.

The decision represents a victory for Daryl L. Thompson, Doe’s attorney, who has been waging battle in the courts for 25 years to allow offenders the opportunity to challenge their placement on the registry.

“There is something fundamentally wrong with one size fits all,” he said.

The court didn’t, however, overturn the law. Instead, it sided with the state’s argument that public safety interests justify the infringement of offenders’ civil rights. If the law were to be declared invalid, the court argued, dismantling the registry would threaten public safety until the Legislature found a suitable replacement.

The justices took issue, though, with the current law’s lack of recourse for rehabilitated offenders. When the law was written, it didn’t include a way to adjust the extent of public notification to suit the offender’s current level of dangerousness, Thompson said.

“There was no way to get out from underneath this statute no matter how your life had reformed,” Thompson said.

The court agreed, saying the consequences for an offender being placed on the registry are too severe without an opportunity for the offender to prove they aren’t a threat.

“Sex offenders are among the most despised people in our society," Matthews wrote in the opinion. "Widespread publication of their conviction and personal details subjects them to community scorn and leaves them vulnerable to harassment and economic and physical reprisals. These serious consequences squarely fall within the evils that the right to privacy was meant to guard against.”

Instead, the Supreme Court opted to allow Doe to file for an individualized risk-assessment hearing in Alaska Superior Court before requiring him to re-register as a sex offender.

The question of how to implement that hearing, and similar hearings for other sex offenders, will fall to the Superior Court, which the Supreme Court said may be able to look to states with similar procedures for a model of how to proceed.

Thompson, Doe’s lawyer, said the parties in his case will brief the Superior Court on how they would like the hearing to be structured with regard to appropriate evidence and level of proof.

Part of that evidence could include testimony from character witnesses, including counselors, clergy or spouses, he said, and the final structure will provide a precedent for future offenders.

Cori Mills, a spokeswoman for the Alaska Department of Law, said Friday her agency was still reviewing the decision and evaluating how it will affect legal procedure.

Trying to implement risk assessments on a case-by-case basis, however, raises too many questions, Chief Justice Joel Bolger and Justice Craig Stowers argued in their dissent — namely, how will the court measure the amount of risk needed to justify registration?

In requiring the Superior Court to answer that question, the justices argued, the Supreme Court was undermining the Legislature, which they said had already tied the justification for registration to the offender’s crime.

Stowers and Bolger also dissented on the idea that sex offenders have an expectation of privacy, saying the fact that their convictions are already public reduces that expectation.