Botswana's High Court on Tuesday struck down a colonial-era law that prohibited consensual same-sex sexual relations in the African nation.

Violators faced up to seven years in prison. A three-judge panel unanimously declared the law unconstitutional.

The Human Rights Campaign (HRC), the largest LGBT rights advocate in the United States, cheered the news, calling the ruling “historic.”

“Today's historic decision by Botswana's High Court puts an end to a law that discriminated against and violated the most fundamental human rights of an entire group of people,” HRC's Jean Freedberg said in a statement. “We congratulate Botswana’s LGBTQ advocates and their legal teams who fought vigorously to achieve this victory and honor the courage of the plaintiff in this case whose voice has given hope to the LGBTQ community in Botswana and so many other places across Africa and the world.”

Homosexuality remains mostly taboo in Africa, where gay sex is criminalized in 31 out of 54 nations, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA).