Kenyan LGBT activists and their supporters gather outside the Milimani Court in Nairobi, Kenya, May 24, 2019. AP

Nairobi, Kenya -- A three-judge panel of Kenya's High Court has upheld sections of the country's penal code that criminalize same-sex relations. The judges' unanimous ruling on Friday disappointed Kenya's vibrant gay community, as many had hoped the court would make history by scrapping the colonial-era laws.

Activists argue that the laws criminalizing consensual same-sex relations between adults are in breach of the constitution because they deny basic rights.

The laws prescribe up to 14 years in prison for people convicted of homosexual acts.

"Kenya's High Court has relegated people in same-sex relationships in Kenya to second-class citizenship, based on the absurd claim that the penal code is not discriminatory," Neela Ghoshal, senior LGBT rights researcher at Human Rights Watch (HRW), said in a statement released by the group on Friday. "The Court of Appeal should revisit this ruling urgently."

Get Breaking News Delivered to Your Inbox

HRW said in its statement that Kenyan activists were already planning to appeal the ruling.

"Kenya has missed an opportunity to take a clear stance against discrimination," HRW quoted Njeri Gateru, director of the National Gay and Lesbian Human Rights Commission, as saying. "I believe justice will eventually prevail in Kenya, as in other parts of the world that have decriminalized same-sex conduct, but in the meantime, ordinary LGBT Kenyans will continue to pay the price for the state's indifference to inequality."

LGBT activist Eric Gitari said before the ruling was handed down that a victory would have had "the potential of creating a tidal wave across Africa, especially in the (countries in) Africa where the British colonial legacy of criminalization still persists."

According to the International Lesbian, Gay, Bisexual, Trans and Intersex Association's 2019 roundup, consensual same-sex sex acts are still officially or unofficially criminalized in 70 U.N. member nations. The same report said the death penalty could be implemented for consensual same-sex sexual acts in at least 10 nations.

Changing attitudes?

The ruling on Friday will reinforce perceptions of Kenya's courts as being conservative on issues of sexuality, but other recent rulings in favor of LGBT rights had brought activists a degree of hope before the High Court decision.

Last year, an appeals court ruled unlawful the use of forced anal exams to test whether two men had gay sex. In 2015, High Court judges ordered a government agency to register a human rights group representing the country's gay people, saying Kenya's constitution recognizes and protects the rights of minorities.

The high court had been set to deliver its ruling on whether to decriminalize same sex relations in February, but postponed it until May. The case stems from a petition filed by gay activists in 2016.

"Kenyans are a tolerant and curious lot," Gitari said. Despite its laws, the country is a haven for LGBT refugees in East and Central Africa with a vibrant social movement and growing government interest in the health of gay people, he said.

But negative stereotypes persist, including the wrong beliefs that all LGBT people are sex workers and all gay men have HIV, Gitari said. At least half of the LGBT people in Kenya have suffered physical and verbal assault, according to a survey by the National Gay and Lesbian Human Rights Commission. Most assaults are not reported because members of the community don't have confidence they will get protection from the police, said Gitari.

Resistance to LGBT rights exists at the top of Kenya's politics; President Uhuru Kenyatta told CNN in an interview last year that the rights of such individuals were, "not of any major importance" in the country. He claimed the laws criminalizing same-sex relations were supported by "99 percent" of the Kenyan people.

"I lost my family and my friends"

For 28-year-old gay rights activist and gospel singer Joji Baro, the memories of discrimination, physical attacks, arbitrary arrests and being disowned by family for coming out are still too fresh, and he said that even if the court had ruled to lift the ban, he wouldn't have gone home.

"Due to my sexuality, I lost my family and my friends," he told The Associated Press on Thursday from his current home in South Africa, where he said he has found "safer ground" for advocacy work.

Baro said he wouldn't feel safe returning home even if gay sex was decriminalized, as things don't change overnight.

The memories are still fresh: being punished as a child for "acting like a girl," being kicked out of his home in his teens, facing physical attacks and the threat of arrest after launching a gay music video.

"For now, my focus is on rebuilding my life and creating a new family of my own," he said.