A judge in Lebanon has declared invalid a law criminalizing gay sex.

The ruling is being hailed as a milestone by activists in Lebanon.

According to the English language The Daily Star, Judge Naji al-Dahdah ruled Article 534 of Lebanon's penal code to be invalid in clearing a transsexual woman of having a same-sex relationship with a man.

Georges Azzi, co-founder of Helem, a group opposed to the law, called the ruling a “big step.”

“It shows we're moving in the right direction,” he said.

“The more we have decisions like this, the more Article 534 becomes irrelevant,” Azzi told the outlet. “Any legal change takes a lot of time but at least this article might stop being used to persecute gay and transgender people in Lebanon.”

The woman at the center of the case had undergone surgery but was listed as male on her personal status registry.

In clearing the woman, Dahdah pointed to a 2009 ruling which stated that consensual gay sex was not against nature and therefore could not be prosecuted under Article 534, which criminalizes “unnatural sexual intercourse.”