PORTLAND, Maine — The debate over Maine’s online sex offender registry shifted from the legislative arena to the state’s highest court Tuesday as justices heard arguments on whether the registry requirement can be applied retroactively.

The Supreme Judicial Court heard appeals by the state in two separate cases involving convicted sexual offenders who declined to register as required by a statutory change. Lower court judges sided with the two men and ruled that the amended law is unconstitutional.

The first case focused on 33-year-old Eric Letalien of Dixfield, who was 19 when he was convicted of rape in 1996 for having sex with a 13-year-old girl. An amended version of the registry law enacted nearly a decade after his conviction requires that Letalien register for the rest of his life, rather than the 15-year period mandated at the time of his conviction.

David Sanders, Letalien’s attorney, said his client lost four jobs for appearing on the state’s sex offender list.

An attorney for the state, meanwhile, defended the law as an effective tool for protecting potential victims from predators.

“There is no private right of secrecy regarding these convictions or any other information on the site,” said Assistant Attorney General Paul Stern. Citing the growing use of the Internet by predators to locate victims, Stern said the registry uses that same technology to help provide protection.

But Sanders said the law trashes individual civil rights protections, unfairly branding individuals as predators and making it harder for them to reintegrate into society. In addition, he said the requirement that offenders undergo periodic booking procedures and have their names posted on a public Web site violates ex post facto restrictions and constitutional guarantees of due process.

Other states have wrestled with the retroactive provisions of their sex offender lists, but Maine remains the harshest, Sanders said. The state requires sex offenders to have a photo taken every three months and report to the police department to update their personal information and be fingerprinted, he said.

A legislative committee has been studying the registry since two offenders were murdered in 2006 by a young Canadian man who randomly found their names on the online listing. Lawmakers are looking at a tiered system in which some names would be known only to police agencies.

Justice Donald Alexander alluded to the 2006 murders when he noted that one of the two victims was on the Web site for committing an offense similar to Letalien’s.

In the second case, the Superior Court dismissed a complaint against Anthony Laclair, and the state appealed. He had been convicted of lesser sex crimes than Letalien. His lawyer, Eric Cote, could not be reached for comment after the hearing.

A decision on both cases is likely within the coming months.