A Louisiana man who spent nearly two decades in prison for a $10 offer of oral sex recently had his sentence reversed.

Unfortunately it came only a few weeks before Shawn Williams’ 20-year sentence was complete.

But the reversal has been seen as an important symbolic victory among advocates who argued one of the laws used to convict him — “crimes against nature” — was blatantly discriminatory.

In 2001, Williams, now 47, offered oral sex to a plainclothes detective in New Orleans. He had a cocaine pipe with residue in his pocket at the time of the incident and also had prior felony convictions on his record.

As reported by nola.com, New Orleans prosecutors went after Williams with full force under the crimes against nature statute. At a one-day trial, a six-person jury found him guilty of cocaine possession and oral sex solicitation. The law treated soliciting oral or anal sex as a felony, while soliciting vaginal sex was a misdemeanor.

Judge Julian Parker handed down the 20-year sentence, but called it “cruel and unusual.” He said he had no choice because 20 years was the minimum sentence allowed under a habitual offender law at the time. Parker could have sentenced Williams to life in prison. The prior convictions that raised Williams' sentence were all for minor offenses like drug possession and solicitation.

“Even though Mr. Williams did go to trial and he did take up the time of the court, the public defender and the district attorney — and he refused his 40-month plea bargain — he is still a human being and in the opinion of the Court is not deserving of the punishment that the Legislature has forced me to give him,” Parker said during sentencing.

Williams’ single-court appeal was denied.

In early July New Orleans’ new district attorney, Jason Williams, petitioned for the court to reverse the sentence citing its link to the controversial crimes against nature statute as “fundamentally unfair.” Judge Nandi Campbell agreed and issued an order July 8 for Williams to be set free.

Nola.com reported that Louisiana has criminalized anal and oral sex under crimes against nature statute since the 19th century. By the early 2000s, soliciting such sex acts was a felony. By 2011, the Louisiana Legislature had done away with the sentencing enhancement for the crimes against nature solicitation. But the legal changes only applied to arrests going forward, not to existing convictions like that of Williams.

According to University of Central Florida research, Florida enacted crimes against nature laws in 1868. While most sections of the law were repealed in 1971, the state still carries “unnatural and lascivious acts” statutes that have been in place since 1917. Section one of the statute reads: “Whoever commits any unnatural and lascivious acts with another person shall be punished by fine not exceeding $500, or by imprisonment not exceeding six months, or by both such fine and imprisonment.”

Meanwhile, Williams’ case is also considered one in a long line of others that have disproportionately used drug laws against Black people like Williams. Nola.com also reported that critics say the law has been used against transgender women of color as well.

“This was a law that was used to enslave us,” Wendi Cooper, the executive director of the transgender rights group Transcending Women, said in a nola.com report. She said Williams was sentenced “behind something that doesn’t make sense, but also did 20 years in a correctional facility for a practice that probably the entire world engages in.”