Forced medical examinations for homosexual men have been banned by Tunisia’s medical council.

Same sex relationships are banned in the north African country, where doctors perform anal "tests" people suspected of engaging in them.

But the National Council of the Medical Order has now decreed that doctors must tell people they have a right to refuse the exams.

Human Rights Watch (HRW) said the announcement, made earlier this month, was an “important” and “courageous” step forward.

Crowd of people hold LGBT dance party outside Mike Pence's house

However, it said that people could still feel compelled to give their "consent" in some circumstances. Campaigners have said the tests can amount to torture.

“Tunisian doctors have taken a courageous step in opposing the use of these torturous exams,” said Neela Ghoshal, senior LGBT rights researcher at HRW.

“To ensure that forced anal testing in Tunisia ends once and for all, police should stop ordering the exams, and courts should refuse to admit the results into evidence.”

However, others argued more action was needed.

"Although the decision of the Tunisian medical council to oppose coercive anal tests is a welcome move, it does not go far enough,” said Peter Tatchell, LGBT rights campaigner.

“Anal tests for homosexuality, regardless of whether they forced or with consent, are unreliable and unethical. They are rightly condemned by medical authorities worldwide."

In Tunisia the tests have been going on for at least nine years and most probably longer.

“Damj [Tunisian LGBT rights group] said they were already hearing of cases when they first started documenting human rights abuses in 2008, and they didn't know how far back the practice dated,” Ms Ghoshal told The Independent.

“Because they were working more or less underground at the time, not much was publicised about these abuses.”

However, a series of high profile cases in Tunisia in recent years has brought more attention to the issue.

Caitlyn Jenner speaks out on Trump failing to protect LGBT people 'this is a disaster'

Two men were arrested in December last year and subjected to the tests. Despite ‘passing’ the exam both were sentenced to eight months in prison in March.

Earlier HRW reports also documented a number of other cases of men being subject to the abuse in 2015.

“I took my pants off and had to get on the table,” one man told the charity. “He entered one finger inside my anus, with cream on it. He put his finger in and was looking. While putting his finger in, he said, ‘Are you ok now’, I said, ‘No I’m not okay.’ It was painful.

“Then he put in a tube. It was to see if there was sperm. He pushed the tube far inside. It was about the length of a finger. It felt painful. I felt like I was an animal, because I felt like I didn’t have any respect. I felt like they were violating me.”

HRW and other rights groups have been lobbying the medical council since 2015 but it was not immediately clear what prompted the announcement.

The best LGBT+ honeymoon destinations Show all 16 1 /16 The best LGBT+ honeymoon destinations The best LGBT+ honeymoon destinations Bora Bora is textbook honeymoon territory Out of Office The best LGBT+ honeymoon destinations The stilt fishermen of Sri Lanka Out of Office The best LGBT+ honeymoon destinations Santorini sunsets are among the best in the world Out of Office The best LGBT+ honeymoon destinations Team Sri Lanka with the Maldives Out of Office The best LGBT+ honeymoon destinations There's more to Mykonos than its party reputation Out of Office The best LGBT+ honeymoon destinations Honolulu's the place for top notch hotels Out of Office The best LGBT+ honeymoon destinations Rotorua in New Zealand - perfect for a different kind of honeymoon Out of Office The best LGBT+ honeymoon destinations Pick South Africa for a properly wild honeymoon MHVILJOEN/Out of Office The best LGBT+ honeymoon destinations And relax, at Le Meridien Bora Bora Out of Office The best LGBT+ honeymoon destinations Bora Bora's your typical honeymoon destination Out of Office The best LGBT+ honeymoon destinations Iceland's magnificent landscape is a pretty impressive start to a marriage Out of Office The best LGBT+ honeymoon destinations Some beaches are better for same-sex couples than others Out of Office The best LGBT+ honeymoon destinations Iguazu Falls straddle Brazil and Argentina Out of Office The best LGBT+ honeymoon destinations A honeymoon in Iceland might turn up the Northern Lights Out of Office The best LGBT+ honeymoon destinations Rio embraces LGBT travellers Out of Office The best LGBT+ honeymoon destinations Queenstown New Zealand Out of Office

However, HRW welcomed the development and hoped it would inspire change in other places.

“It is time for the world to say a resounding no to the use of forced anal exams everywhere,” Ms Ghoshal said.