An Egyptian court convicted nine men of “inciting debauchery” after they appeared in a YouTube video of an alleged fake gay wedding on the Nile. Authorities arrested the men in September after the video went viral.

One man said the marriage was a joke and the party was a birthday celebration. He claims the men did not “intend to portray a wedding” and there were women on the boat, but they were not in the video. Two men exchanged rings among cheering friends. Egypt’s chief prosecutor said the actions were “shameful to God” and “offensive to public morals.”

Homosexuality is not illegal in Egypt, but it does violate some of its morality laws. The law used to convict the men was implemented after Egypt gained independence from the United Kingdom in 1922. It is Law 10/1961, which targeted the “licensed brothels that had existed under British rule.” It banned all prostitution and all debauchery. However, the law does not specifically state behaviors that fall under debauchery. The Atlantic reports:

The result was passing a law that criminalized promiscuity in general. Not only did the legislation outlaw female prostitution, but it also prohibited what it called “debauchery”–without actually defining what might constitute debauched behavior. Without looking for evidence that money had changed hands, police began arresting men for engaging in gay sex under the debauchery provision. “The motives didn’t matter so much as the fact that the elastic language permitted the law to expand with the scope of moral indignation,” [Cairo-based LGBT rights activist Scott] Long, who is working on a book on the subject, noted. As he summed it up: “A moral panic led to a ridiculously broad and vague law.”  

Later, Egyptian courts would expand the law’s scope. A decision in the 1970s by the Court of Cassation, the highest court of legal interpretation in the country, definitively stated that the debauchery provision meant sex between two men, regardless of whether or not money was exchanged. Under this interpretation, “debauchery” would mean that the sex would be “habitual” and “without discrimination.” Specifically, that meant that for a citizen to be prosecuted, he had to have sex with more than one man in a three-year period.

Men arrested for homosexuality must endure “medical tests.” It includes an examination of the private areas, including the anus for penetration. The United Kingdom’s Pink News reported the men tested negative for homosexuality.

Egypt’s past is littered with investigations against homosexuality, which outraged human rights organizations and the West. In 2001, police arrested 52 men after a raid on a disco boat called the Queen Boat. Egypt also sent four men to prison under anti-debauchery laws in April.