Updated

A Kenyan appeals court has blocked authorities from using an anal examination to test whether two men had gay sex, which is criminalized in the East African nation.

Appellate Court Judge Alnashir Visram on Thursday said the high court decision was unconstitutional and violated human rights.

Eric Gitari, the chairman of the National Gay and Lesbian Human Rights Commission, calls the ruling a "tremendous" step in upholding the dignity of homosexuals. Activists have called the tests torture.

Human Rights Watch has said Kenya is one of at least eight countries that have used forced anal exams since 2010. Six are in Africa.

In the current case, two Kenyan men in 2016 were charged with engaging in homosexuality. Police asked the high court to order the men to undergo anal examinations.