Campaigners have condemned the jailing of two men accused of consensual same-sex activity in Morocco.

Human Rights Watch (HRW) and the Aswat Group for Sexual Minorities, a Moroccan group, today called for their release, saying their convictions infringes upon Morocco’s 2011 Constitution which states a right to a private life.

The two defendants were arrested on 13 December and subsequently convicted by the First Instance Court in the Mediterranean city of al Hoceima. The trial was held just five days after their arrest.

According to HRW, the men were convicted based on police “confessions” made in pre-trial detention.

It is claimed the defendants repudiated before the judge. The court called no witnesses to testify. An appeals court upheld the sentence on 30 December.

Sarah Leah Whitson, HRW’s Middle East and North Africa director, condemned the Moroccan authorities for prosecuting the men and said the testimony could not be relied upon.

“The combination of a state that enforces sodomy laws, a justice system that denies a fair trial, and the social stigma attached to homosexuality is a formula for damaging people’s lives,” she said.

The al Hoceima Appeals Court upheld the conviction for committing a “deviant sexual act with a member of the same sex” and for “public indecency”, but reduced the sentences for both men from three years in prison and a fine to six months for one and one year for the other, who was also convicted of attempted bribery.

The older defendant is an elected local official in his 50s and the other a student in his 20s.

Same-sex sexual activity is a crime in Morocco, with a maximum possible sentence of 3 years.

Ray Cole, a gay British man, was briefly jailed in the country last year under Morocco’s anti-gay laws.

Mr Cole and his Moroccan friend were subsequently released following a high-profile campaign.

Moroccan law penalises what it refers to as acts of “sexual deviancy” between members of the same sex, a term that police reports and court documents use to refer to homosexuality more generally.