Earlier this month, a district court of appeals in Lebanon issued a groundbreaking ruling finding that consensual sex between people of the same sex is not unlawful, according to Human Rights Watch.

The ruling follows similar judgements from lower courts that have declined to convict gay or transgender people under article 534, which prohibits “sexual intercourse contrary to nature,” in four separate rulings between 2007 and 2017.

LGBTQ advocates in Lebanon have been fighting to repeal article 534’s prohibition on consensual same-sex conduct for the better part of a decade. The law, a relic of a time when Lebanon was colonized by the French in the early 1900s, punishes “any sexual intercourse contrary to the order of nature” with up to one year in prison.

The court’s ruling in this most recent case was related to the 2015 arrest of nine people in a suburb of Beirut on suspicion that they were gay or transgender. A criminal court declined to convict them in 2017, when a judge said that “homosexuals have a right to human and intimate relationships with whoever they want, without any interference or discrimination in terms of their sexual inclinations, as it is the case with other people.”

The Lebanese government subsequently appealed the decision to the Court of Criminal Appeal, where a three-judge panel upheld the acquittal. The appeals court ruled that the penal code should be interpreted in accordance with “common sense” and the principles of social justice. The court found that consensual sex between same-sex partners cannot be considered “unnatural” so long as it does not violate morality and ethics, such as “when it is seen or heard by others, or performed in a public place, or involving a minor who must be protected.”

LGBTQ advocates have hailed the ruling as a step towards the eventual decriminalization of homosexual conduct.

“This ruling signals a new horizon for lesbian, gay, bisexual, and transgender people in Lebanon, who have long been persecuted under discriminatory laws,” Neela Ghoshal, a senior researcher on LGBT rights at Human Rights Watch, said in a statement. “The court has effectively ordered the state to get out of people’s bedrooms.”

Youmna Makhlouf, one of the lawyers representing the defendants on behalf of the civil rights group Legal Agenda, said the case is significant because appeals court rulings may serve as precedent for lower courts. While judges are not legally bound by the precedent, and may still convict people of homosexual conduct under article 534, they are likely to give serious consideration to the ruling in similar cases, says Makhlouf.

The Lebanese government has not yet indicated whether it will appeal the case to the country’s highest court, the Court of Cassation.

Georges Azzi, the executive director of the Arab Foundation for Freedoms and Equality, which defends the right of LGBTQ people throughout the Middle East and North Africa, told Human Rights Watch that defense lawyers worked closely with Lebanese LGBTQ rights organizations in urging the court to uphold the acquittal.

“It was a very progressive ruling, [stating] that the government has no business in people’s private lives,” Azzi said. “Other courts could still convict people, but we’re very hopeful — we’re seeing that the trend now is not to criminalize homosexuality.”

In recent elections, several parliamentary candidates advocated repealing article 534. Human Rights Watch has recommended that the new parliament should do so once it convenes.

“Despite the positive developments in the courts, the reality is that same-sex couples can still face jail time in Lebanon,” Ghoshal said. “Parliamentarians should follow the courts’ lead and repeal article 534.”