A protestor waves the gay pride flag as others hold banners during an anti-homophobia rally in Beirut on April 30, 2013. (JOSEPH EID/AFP/Getty Images)

A court in Lebanon has ruled that the country’s law does not ban homosexuality.

The decision to uphold the acquittal of nine people prosecuted for being gay in 2017 has been celebrated by activists, who view it as a landmark moment in the fight to decriminalise homosexuality.

The July 12 ruling was handed down by a Mount Lebanon appeals court, the highest judicial authority to find in favour of equality so far, according to AFP.

It rejected an appeal to overturn a lower court’s ruling in January last year that if Lebanese citizens wanted to have gay sex, it was “a practice of their fundamental rights.”

The nine people acquitted in that decision had been charged under Article 534 of the Lebanese Penal Code, which bans sexual acts which “contradict the laws of nature,” making them punishable with one year in prison.

But last week, the Mount Lebanon judges ruled that when they were constructing this law, “legislators had not intended to criminalise homosexuality but rather offence to public morals.”

Karim Nammour of Legal Agenda, an activist group fighting for LGBT equality, said that the decision means “homosexual relations are not a crime, as long as they are between two adults and do not occur in a public space.”

Nammour, who is a lawyer, said this was the fifth such verdict in support of equality for gay people, but that a ruling from such a high-ranking court was unprecedented.

“The appeals court has a certain authority… It’s higher in the hierarchy,” he said.

Nammour added that the ruling was “much more than symbolic.

“It could have repercussions on the way that lower court judges rule.”

Helem, a prominent LGBT organisation in the country, tweeted in response to the decision: “Congratulations for the LGBTQI+ community in Lebanon. A victory signed by Helem and @Legal_Agenda.

“The court of appeal endorses for the 1st time ruling by judge: Homosexuality is not a crime.”

Congratulations for the LGBTQI+ community in Lebanon. A victory signed by Helem and @Legal_Agenda The court of appeal endorses for the 1st time ruling by judge: Homosexuality is not a crime https://t.co/WhW2owRSQo — Helem Official (@HelemLebanon) July 13, 2018

Earlier this year, right-wing Christian Democrat party Kataeb called for the country’s government to decriminalise gay sex.

The party announced plans to scrap the law on television, in a groundbreaking move.

But in May, Beirut Pride organiser Hadi Damien told PinkNews that he was threatened with immorality charges if the annual celebration was not cancelled.

Damien was held overnight at Hbeish police station in the capital before being released only after apparently being coerced into agreeing to cancel all Pride events.

Beirut Pride was launched in 2017, apparently as the first LGBT+ event of its kind in the Arab world.