Tunis - Tunisia, where sodomy is punishable by jail, has banned forced anal examinations to determine sexual orientation, the North African state's minister for human rights said on Friday.
The authorities carry out the tests on suspected homosexuals but "these exams can no longer be imposed by force, physical or moral, or without the consent of the person concerned", Mehdi Ben Gharbia told AFP.
Foreign and local rights groups have condemned the practice of forced anal exams as "cruel" and "inhuman".
Ben Gharbia said judges can still request that a suspect undergo the test "but that person has every right to refuse, without his refusal being held up as proof of homosexuality".
Tunisia is "committed to protecting the sexual minority from any form of stigmatisation, discrimination and violence," he added.
Tunisia's transition to democracy since a 2011 revolution against dictator Zine El Abidine Ben Ali has allowed for open debate on the situation of its gay and lesbian community.
But homosexuality is still punishable by three years in jail under Article 230 of Tunisia's criminal code, which President Beji Caid Essebsi has said would not be repealed.
"Civil society must first be prepared" for such change in the conservative Muslim country, said Ben Gharbia.