A Cairo court on Sunday released 17 people arrested last month in a crackdown by authorities on homosexuality, judicial sources said.

They had been charged with practising homosexuality and inciting debauchery and were sentenced to three years in prison should they fail to pay fines of $285.

The defendants have been given leave to appeal against the sentences in a higher court.

Although homosexuality is not specifically outlawed in Egypt, it is a conservative society and discrimination is rife. Gay men are frequently arrested and typically charged with debauchery, immorality or blasphemy.

In October, Egyptian security forces arrested 57 people in a wave of arrests triggered by the raising of a rainbow flag at a music concert.

The overwhelming majority of those arrested were not involved in the flag incident, however, and were arrested over their perceived sexual orientation in the following days.