Kenya's High Court has upheld laws that criminalize sex between two people of the same sex.

A three-judge panel ruled Friday that the colonial era laws did not target Kenya's LGBT community, NPR reported.

The laws being considered penalize “carnal knowledge … against the order of nature” with up to 14 years in prison and “indecent practices between males” with up to five years.

Kenya gained its independence from Britain in 1963.

Human Rights Watch said that the laws have been used to justify discrimination and violence against the LGBT community. The group said that the laws were rarely enforced.

Kenyan LGBT rights advocates had hoped that the judges would strike down the laws as unconstitutional. They vowed to appeal Friday's ruling.

Speaking with The Associated Press, Eric Gitari, who with the support of LGBT rights groups filed the case challenging the laws, said: “What will happen is that more and more people are going to closet themselves, they are going to live in shame and fear.”