A man has been jailed for eight months under Tunisia's anti-gay laws after reporting that he had been raped by two male robbers, it has been claimed.

The 22-year-old is said to have gone to a police station in the southern Tunisian town of Sfax to report the alleged assault and robbery - only to be arrested himself.

A gay rights group in the North African country said he was accused of homosexuality and forced to undergo an invasive anal examination.

A 22-year-old is said to have gone to a police station in the southern Tunisian town of Sfax (pictured) to report that he had been raped by two male robbers - only to be arrested himself

A court has now ordered the man to serve a total of eight months behind bars for homosexuality and bringing a 'false allegation' after he was deemed to have consented to sex, according to reports.

His alleged attackers, meanwhile, were handed eight month sentences for homosexuality, physical assault and theft, the Independent reports.

Shams, a gay rights group in Tunisia, said the man and his supporters would appeal the court ruling.

The group president Mounir Baatour told The Independent that the man's family had been left reeling after the judgement.

A petition has been launched on the Allout website calling for the man's release.

In November Human Rights Watch claimed that men suspected of being gay were being forced to undergo anal tests in Tunisia.

Addressing the latest alleged case, the NGO said: 'These unscientific and invasive "exams", in which doctors penetrate a victim with a finger or an object to assess whether they "habitually" engage in anal sex, violate international law and can be traumatic for anyone who undergoes them – let alone a rape victim.'

It added: 'Tunisia should uphold its commitment to human rights and stop subjecting its citizens to such brutal indignities.'

Under article 230 of Tunisia's penal code, those guilty of same-sex sexual relations face up to three years in prison.