JOHANNESBURG (AP) — Botswana became the latest country to decriminalize gay sex on Tuesday, a landmark case for Africa, as the High Court rejected laws punishing it with up to seven years in prison.

Jubilant activists in the packed courtroom cheered the unanimous decision in the southern African nation that is seen as one of the continent’s most stable and democratic. The ruling came less than a month after Kenya’s High Court had upheld similar sections of its own penal code in another closely watched case.

More than two dozen countries in sub-Saharan Africa have laws criminalizing gay sex, often holdovers from colonial times. Earlier this year, the southern African nation of Angola decriminalized same-sex activity and banned discrimination based on sexual orientation.

Those arguing against the laws say they leave people in the LGBT community vulnerable to discrimination and abuse while making it difficult to access basic health and other services.

The Botswana-based non-governmental group LEGABIBO, which supported the anonymous petitioner in the case, has said such laws “infringe on basic human dignity.”

People in the courtroom were ecstatic, leaping up, clapping and ululating, LEGABIBO legal policy director Caine Youngman told The Associated Press. When the judges said the right to privacy includes the right to choose a partner, “it hit home,” he said.

“I’m a gay man. I’ve been out for many years. Now I can live with my partner without worry,” Youngman said. He said the state might appeal “to appease the homophobes” and has 30 working days to do so.

The ruling led to rejoicing from rights groups that had expressed frustration with the Kenyan decision last month, including ones in countries such as Nigeria, Uganda and Ghana where gay sex remains illegal. Amnesty International called on other African nations to follow Botswana’s example in “an exciting new era of acceptance.”

Botswana’s High Court said in its ruling that penalizing people for who they are is disrespectful and discriminatory, and that the law should not deal with private acts between consenting adults.

Sexual orientation is innate and not a “fashion statement,” the judges said. “Any criminalization of love or finding fulfillment in love dilutes compassion and tolerance.”

The ruling cited the recent decriminalization in India and elsewhere. It also pointed out that all three arms of Botswana’s government have expressed the need to protect the rights of the gay community.

Before the ruling, LEGABIBO shared a comment attributed to President Mokgweetsi Masisi: “There are also many people of same-sex relationships in this country who have been violated and have also suffered in silence for fear of being discriminated. Just like other citizens, they deserve to have their rights protected.”

The judges cited the president’s comment in their ruling.

Botswana in recent years has taken other steps toward protecting LGBT rights. The High Court in 2017 ruled that the government should issue a transgender man documentation reflecting his identity. And in 2016 an appeals court ruled that LEGABIBO could register as a nonprofit.

“It is a day to celebrate pride, compassion and love,” UNAIDS executive director Gunilla Carlsson said in a statement after Tuesday’s ruling. Prohibitive legal environments increase the vulnerability of gay men, transgender women and others to HIV, the statement said.

Copyright 2024 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Join our Newsletter for the latest news right to your inbox