Tunis (AFP) - A court in Tunisia has sentenced six students to three years in jail each on charges of homosexuality in a judgment condemned by rights activists, their lawyer said on Monday.

The court in Kairouan last week handed down the maximum term under a controversial article of the criminal code that criminalises sex between males, Boutheina Karkni said.

The six were also banned from the central city for five years after they complete their sentences, she said.

The young men were detained in November and December after "neighbours denounced them" and were made to undergo anal examinations, she said.

Karkni described the ruling as "extremely harsh" and said an appeal hearing should take place "in two to three weeks" in the nearby coastal city of Sousse.

One defendant was handed an extra six months behind bars for "offensive" videos found on his computer, the huffpostmaghreb.com news site reported.

Rights group Amnesty International in a statement denounced the ruling as "a shocking example of deep-rooted state sanctioned discrimination".

It said anal examinations "amount to torture when carried out involuntarily", and called for the immediate and unconditional release of the six.

Local rights group Shams, which calls for decriminalising homosexuality in Tunisia by revising Article 230 of the penal code, condemned the judgment.

Human Rights Watch's country director also denounced the ruling as "a grave case of infringement on people's private lives and physical integrity".

Amna Guellali described the sentences, which included the "extremely rare" penalty of "banishment", as "mediaeval and not consistent with Tunisia's evolution".

Balkis Mechri of the local Human Rights League agreed.

"The banishment really is scandalous," she said, calling on civil society to "react strongly" in the case.

But interior ministry spokesman Walid Louguini defended the ruling.

"Our job is to uphold the law," radio station Shems FM reported him as saying.

Story continues

In September, a court sentenced a student to a year behind bars in Sousse on charges of homosexuality, also after he was examined anally.

He was released in November pending an appeal hearing expected on Thursday.

After the September judgment, then justice minister Salah Ben Aissa made a controversial call for Article 230 to be scrapped and was sacked in October.