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.