Tunisia has pledged to stop forcing people suspected of being gay to undergo anal examinations.

Sodomy is still punishable by jail in the North African country, but its minister for human rights said the invasive practice used to determine sexual orientation will now be stopped.

Mehdi Ben Gharbia said state authorities carry out the tests but stressed 'these exams can no longer be imposed by force, physical or moral, or without the consent of the person concerned'.

He did not, however, give a specific date for the change to be implemented.

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', under the change.

Tunisia is 'committed to protecting the sexual minority from any form of stigmatization, discrimination, and violence,' the minister insisted.

The charity Amnesty International said it considers the anal examinations to amount to torture after a human rights review at the UN yesterday.

Amnesty said the commitment to cease the intrusive practice was welcome, but 'deeply' regretted that homosexuality was still illegal in the country.

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 several youths were arrested on charges of homosexuality and convicted in 2016.

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, Ben Gharbia said.

This article has been adapted from its original source.