CAIRO — An Egyptian court Saturday convicted eight men for “inciting debauchery” after their appearance in an alleged same-sex wedding party on a Nile boat, sentencing each of them to three years in prison.

An Internet video shows two men exchanging rings and embracing among cheering friends. The eight were detained in September when a statement from the office of Egypt’s chief prosecutor said the video clip was “shameful to God” and “offensive to public morals.”

Egypt is a conservative majority Muslim country with a sizable minority of Christians. Homosexuality is a social taboo for both communities and only in recent years have fiction and movies included gay characters. Consensual same-sex relations are not explicitly prohibited, but other laws have been used to imprison gay men in recent years, including “debauchery” or “shameless public acts.” Same-sex marriage is unheard of in Egypt.

The verdict was received with protesting screams by relatives waiting outside the Cairo courthous. Some of them broke down and cried while others protested that medical examinations carried out by state doctors showed the defendants were not gay.

While inside the defendants’ cage for the hearing, the eight buried their heads in their hands or hid their faces under baseball caps. They covered their faces with pieces of cloth or paper when they were led by police out of the cage after they heard the verdict.

The verdict is the latest in a crackdown by authorities against gays and atheists. The campaign also targets liberal and pro-democracy activists and violators of a draconian law on street protests.

New York-based Human Rights Watch said in September that Egyptian authorities have repeatedly arrested and tortured men suspected of consensual gay conduct. The group condemned Saturday’s convictions as part of a widening campaign of intolerance in Egyptian government and society.

“Egypt’s government, evidently not satisfied jailing opposition members, students, and human rights activists, has found the time to prosecute (gays),” Graeme Reid, the group’s lesbian, gay, bisexual, and transgender rights director, said in a statement. Reid called the sentencing “the latest signal that the new government will prosecute anyone to try to bolster its support.”

In April, four men were convicted and sentenced to eight years in prison for “debauchery” after allegedly holding parties that involved homosexual acts and where women’s clothing and makeup were found.

In 2001, Egypt made headlines around the world when 52 men were arrested in a police raid on a Nile boat restaurant and accused of taking part in a gay sex party. After a trial, 23 of the men were convicted and sentenced to prison terms of one to five years for immoral behavior and contempt of religion.