Eight Egyptian men convicted for "inciting debauchery" following their appearance in a video of an alleged same-sex wedding party cover their faces in the defendant's cage in a courtroom in Cairo.

On Saturday, an Egyptian court convicted eight men for "inciting debauchery." Their crime was their appearance in a video that went viral for depicting what is ostensibly the country's first same-sex wedding party. The court sentenced each of the men to three years in prison.

The video, which surfaced on YouTube in various forms, shows two men exchanging rings and embracing while onlookers cheer—something Egypt's chief prosecutor said was "shameful to God" and "offensive to public morals" when the men were charged in September.

But Egypt, a country that has a hard time acknowledging the existence of gay citizens within its borders, has no laws against homosexuality. Instead, the law that was used to prosecute the men is one with roots in British colonialism—one meant to rid the newly independent Egypt of the licensed brothels that had existed under British rule. Known as Law 10/1961 on the Combating of Prostitution, it banned prostitution of all forms, in a brothel or elsewhere.

"Both the Wafd, the main nationalist party, and the religious conservatives including the Muslim Brotherhood saw the existence of licensed brothels where Egyptian women served British soldiers as a comprehensive national humiliation," the LGBT rights activist Scott Long, who is based in Cairo, told me in an email.