A Kenyan High Court has dismissed a case challenging the legality of anal tests as proof of homosexuality.
Two men, who say Kenyan police forced them to undergo the procedure to prove they had had gay sex, launched the case, calling for the tests to be declared unconstitutional.
“There was no other way evidence could have been obtained,” ruled Mombasa judge Mathew Emukule.
Homosexual acts are illegal in Kenya, punishable by up to 14 years in prison.
The judge dismissed claims by the two men that they were sexually discriminated against and that the tests were tantamount to torture.
“I find no violation of human dignity, right to privacy and right to freedom of the petitioners,” he said, reports the AP news agency.
Their lawyer confirmed that they will appeal against the decision.
Their trial for allegedly having gay sex is ongoing.
“I sat in court holding my chin in disbelief,” said Eric Gitari, executive director of the Kenyan National Gay and Lesbian Human Rights Commission, which supported the petition.
A recent investigation by the rights group Human Rights Watch (HRW) found that many lesbian, gay, bisexual and transgender (LGBT) people have “daily safety concerns”.
Their report, written with local rights group Persons Marginalised and Aggrieved (Pema) Kenya, details six incidents since 2008 where they say LGBT people were threatened near Mombasa.
The group added that in most cases the police did protect the LGBT people, but it alleges that the perpetrators were not arrested