A court has acquitted 26 men who had been arrested by police looking for gays at a Cairo bathhouse.
Some of the defendants kept their faces hidden behind jacket hoods and scarves, traumatised by the humiliation, while others uncovered their faces and wept openly after the verdict.
Same-sex relations are not explicitly prohibited under Egyptian law but remain a taboo. The men faced various charges, including debauchery.
The case caught the public’s attention after a pro-government TV network aired scenes of men being pulled from the bathhouse by police during the raid on 7 December.
The courtroom erupted into a frenzy after the word "acquittal" was heard from the judge and women ululated. Scott Long, an American researcher who had followed the case, said he was both "shocked and delighted".
"I hope this is a sign that these raids will come to an end," Mr Long told the Associated Press amid the cheering. "Finally there was a judge who listened to the evidence."
Rights activists say 2014 was the worst year in a decade for Egypt's gay community, with at least 150 men arrested or put on trial.
"They destroyed our lives. God rescued us," said one of the defendants.
The trial opened only two weeks after the December 7 raid on the bathhouse, or hammam, after quick referral by the general prosecutor.
There are no laws in Egypt criminalising homosexuality but a decades' old law criminalising prostitution is often used in penalising the gay community. Five of the defendants in Monday's trial - the owner of the bathhouse and four staff members - were tried for facilitating debauchery in exchange for money.
In the official charges, the prosecutor said the investigation revealed the owner and the staff ran the bathhouse as a place for "parties of debauchery, orgies among male homosexuals in exchange for money". The rest of the defendants were charged with practising debauchery and "indecent public acts".
The crackdown on the gay community in Egypt, and also recently on atheists, goes hand in hand with a wider campaign against all forms of dissent and diversity in a country gripped by rising nationalism and a militant insurgency