The High Court of Kenya ruled on Friday that the board overseeing NGOs cannot bar an LGBT rights group from formally organizing, a ruling that may create precedent to win protections for LGBT people under the East African country’s constitution.

Eric Gitari attempted to register the organization he leads, Kenya’s National Gay & Lesbian Human Rights Commission (NGLHRC), with the office responsible for granting the permits that give official status to NGOs in the spring of 2013. The Non-Governmental Organisations Coordination Board refused his filing.

In a March 2013 letter, the NGO Coordination Board told NGLHRC that it could not register because the Kenyan penal code “criminalises gay or lesbian liaisons.” This assertion was based on a provision inherited from the criminal code imposed when Kenya was a British colony that makes it a crime for someone to have “carnal knowledge of any person against the order of nature.”

The High Court held not only that the Board violated Gitari’s right to freedom of association, but also suggested that protections for fundamental rights in the Kenyan constitution could be read to expressly forbid discrimination on the basis of sexual orientation.

“An interpretation of non-discrimination which excludes people based on their sexual orientation would be in conflict with the principles of human dignity, inclusiveness, equality, human rights, and non-discrimination” the three judge panel held in a portion of their ruling interpreting three sections of the Kenyan constitution concerning fundamental rights.

If this precedent is applied to future cases, it could open the door to a wide range of litigation making it a bright spot for LGBT rights in East Africa. It could also counter some recent political trends that have made Kenyan LGBT-rights advocates nervous. Some lawmakers called for more aggressively prosecuting crimes under the seldom-used unnatural offenses provision following the passage of the sweeping Anti-Homosexuality Act in neighboring Uganda in 2014.

The entire unnatural offenses provision could possibly fall as a result of this ruling. Gitari announced last summer that he would file a challenge to the code, and Friday’s ruling seemed to have given him strong precedent for striking it. Gitari told BuzzFeed News that he expects to file the lawsuit this September.

In addition to passages rejecting the state’s case for denying the group based on the bible, Quran, or “moral convictions,” the High Court hinted that the unnatural offenses provision might be so vague as to be vulnerable to challenge as a provision for prosecuting homosexual intercourse.

“That the State does not set out to prosecute people who confess to be lesbians and homosexuals in this country is a clear manifestation that such sexual orientation is not necessarily criminalised,” the judges wrote. “What is deemed to be criminal …. is certain sexual conduct ‘against the order of nature,” but the provision does not define what the ‘order of nature’ is.”

This ruling is just the latest in a series of recent LGBT victories in Kenyan courts. Last July, a High Court judge ruled that the NGO Board could not deny registration to a trans-rights organization, and a court ruled in October that prohibitions on gender discrimination should be interpreted as protecting transgender people in a case brought by a trans woman seeking to be listed as female in her school record.

Here is the full ruling:

J. Lester Feder is a world correspondent for BuzzFeed News and is based in Washington, D.C.