Charlton Green was 20 when he was arrested after having oral sex with a 16-year-old male in a Georgia hotel room.

He was convicted of a sex crime — not because the act was not consensual (it was), nor because the teen was not within the age of consent (in Georgia, it is 16). He was convicted because the incident happened in 1997, when oral and anal sex between consenting adults was prohibited under Georgia’s sodomy law. The conviction required him to register as a sex offender, a stigmatizing label that he carried for years.

Georgia’s Supreme Court invalidated the state’s sodomy law a year later, and the U.S. Supreme Court ruled against all such state laws in 2003, but Green’s legal status remains the same. Although his name was removed from the sex-offender registry in 2012, he remains convicted of sodomy and failure to register as a sex offender. Last week, the 11th U.S. Circuit Court of Appeals reversed a federal-district court’s ruling that would’ve thrown out those convictions.

Green’s case, debated for years in state and federal courts, is a remnant of antiquated laws that punished people for their sexual choices and disproportionately affected gays and lesbians, advocates say. Camilla Taylor, a lawyer for Lambda Legal, an advocacy group that advocates for LGBT rights, said many sodomy laws made criminals of gays and lesbians because of how they choose to have sex. Texas, for example, prohibited consensual sex acts between individuals of the same sex.

“In an era where sodomy laws could be enforced, people who acknowledged being gay tipped off police forces or were fired from their job. It’s considered an acknowledgment that they were presumed criminals and that presumed criminality maimed every aspect of their public life,” Taylor told The Washington Post.

In Georgia, the law was written so vaguely that it criminalized anal and oral sex regardless of sexual orientation. The state considered it a felony punishable by up to 20 years in prison.

Green pleaded guilty to sodomy in Pickens County, north of Atlanta, in 1997 and was sentenced to three years of probation and required to register as a sex offender.

When Georgia’s Supreme Court struck down the state’s sodomy law a year later, advocates saw it as a victory “against a notorious national symbol of anti-gay hostility and discrimination.” Just 12 years earlier, the U.S. Supreme Court had upheld Georgia’s sodomy law, saying “the Constitution does not confer a fundamental right upon homosexuals to engage in sodomy.”

In light of the Georgia court’s ruling, Green asked the Pickens County court to terminate or modify his sentence, but a judge denied his motion without explanation, court records say.

Green faced other crimes, including a 2009 conviction in a neighboring county for failure to register as a sex offender, which prolonged his probation and sent him to prison for two years. He asked for a new trial, saying the U.S. Supreme Court’s 2003 ruling against state sodomy laws had freed him from having to register as a sex offender.

But Green’s request for a new trial was denied. The state appeals court said that the Supreme Court’s ruling in Lawrence v. Texas protected only private sex acts — and that Green’s was not one of them. (Two women were inside the hotel room with Green and the 16-year-old, so the state appeals court ruled that the sex act did not happen in private.)

Taylor, the Lambda Legal attorney, disagreed.

“I think Lawrence was about more than whether the walls are good enough or whether there’s a possibility of other people viewing the activity,” she said. “Lawrence was ultimately about the ability to exercise autonomy and make sexual choices for themselves that do not harm other people.”

Green found some reprieve, albeit a brief one, in 2010, when a Pickens County judge found that his sodomy conviction was invalid. The state appeals court reversed that ruling the following year on procedural grounds. “A motion to vacate a judgment of conviction is not an established procedure for challenging the validity of a judgment in a criminal case,” the court ruled.

Green’s legal battle eventually brought him to the federal court, where he asked for a habeas corpus relief, a move that allows defendants to argue that the conviction or sentence they received in state court violates federal law. A federal district judge granted his petition, saying Green “should not have been required to register as a sex offender and therefore could not be held guilty of the instant offense.” It was, again, only a temporary reprieve. On Friday, the 11th Circuit Court of Appeals reversed that ruling, saying the federal court lacked authority to entertain a challenge to Green’s sodomy conviction.

Green’s attorney, Stephen Scarborough, declined to comment. The attorney general’s office in Georgia did not respond to a call from The Post.

Illinois was the first state to repeal its sodomy statute, in 1961. Nearly two dozen states did so in the 1970s and 1980s. Nevada, Arizona and the District of Columbia followed suit in the 1990s and early 2000s. In California, the legal fight lasted for six years and culminated in a dramatic tie-breaking vote in the Senate by the lieutenant governor in 1975.

Other states, such as New York, Pennsylvania, Georgia, Kentucky, Tennessee, Montana and Minnesota, relied on their high courts instead of the legislature to invalidate sodomy laws.

The U.S. Supreme Court’s landmark ruling, which struck down sodomy laws that were still enforced in 13 states, was a “sea of change” for the LGBT community, Taylor said.

“It allowed same-sex couples to fight even more strongly for the freedom to marry, now that same-sex couples cannot be doomed or presumed criminals based on their love for each other,” she said. “It was a boost to the marriage movement.”

More than a decade after that ruling, Virginia removed sodomy laws from its books. The laws, however, still exist in the books of a handful of states, though the Supreme Court has deemed them unenforceable. Such is the case in Georgia.

“In a state with overwhelmingly conservative legislators in the majority, there is simply not the political will to address this repeal as a stand-alone measure,” said Jeff Graham, executive director of Georgia Equality.

Correction: An initial version of this story incorrectly reported that Charlton Green is still considered a sex offender. Green was removed from the sex offender registry in 2012, although his convictions of sodomy and failure to register still stand.

Read more: