Dozens of men stand shivering in a rusty black cage along a wall - the way defendants are usually held here during trial. Alleged homosexuals, most of the men cover their faces in white scarves, some fashioned into masks with slits for the eyes.
Waiting some two hours for the judge and prosecutor to arrive, some prisoners faint from the cramped, steamy conditions. Fellow defendants slap them awake.
For Egypt's homosexuals, the so-called "Queen Boat" trial is likely to signal the end of a road to a new openness, which had begun to emerge in recent years.
In the trial, being seen by some observers as part of a clash between Islamic traditionalists and proponents of a more tolerant, more secular society, it is unclear what laws were broken.
It is also unclear how many of the 52 accused are actually homosexuals.
Some observers say the proceedings are a government attempt to display what it sees as as corrupting Western influences and spread fear.
"If the government wants this trial to be a deterrent, they will succeed," says a European diplomat who is among several Western observers monitoring the case. "This trial is sure to drive gay foreigners away and gay Egyptians underground."
The trial is unfolding amid a broader Islamic fundamentalist campaign against erotic literature and other manifestations of what many Muslims interpret as Western-inspired moral decay.
The chief prosecutor has repeatedly pointed to Western nations, which he says accept and tolerate what "Islam considers a crime."
"Egypt has not and will not be a den for the corruption of manhood, and homosexual groups will not establish themselves here," said prosecutor Ashraf Helal, addressing the courtroom and the cage of defendants earlier this month.
Most of the 52 defendants were arrested in May on a Nile cruise ship called the Queen Boat, a well-known haven in the world of Cairo's homosexuals. No sexual activities were observed on the boat, but police say they have photos, medical reports, and confessions to back their charges that all the men are gay.
The government's main target is Sherif Farahat, an outspoken homosexual who was on the boat. Mr. Farahat is also being charged with authoring a book found in his house that dubs Egyptian homosexuals as "soldiers of the Lord's army" who would fight for a future Kurdish messiah. The prosecution has tried with some difficulty to link all of the 52 men with their alleged "ring leader," Farahat.
"There is no crime called homosexuality in Egyptian legislation, so the government really doesn't know what to charge these people with," says Gesir Abdul Rezk, director of the Hisham Mubarak Law Center in Cairo.
As in other, much smaller, cases in recent years, Egyptian prosecutors are relying heavily on a 1961 antiprostitution law that outlaws fouger, a vague term that means little more than "shameless bad behavior."
Since the trial is being held under the auspices of Egypt's emergency laws - in place since 1981 to fight militant Muslim violence - defendants are expected to have no right of appeal if convicted on the charges, which could send them to prison for up to five years.
In its campaign against homosexuality, the government is using what Western diplomats and human rights groups characterize as "dubious tactics."
During one of several heated court sessions in the trial, which continues this month, the accused men alleged that authorities were using electric shocks and beatings to secure confessions and punish them in prison.
One man, who gives his name as Hatem Ibrahim, says he has been physically abused during so-called medical exams as well as severely beaten by an Egyptian policeman.
Many Egyptian homosexuals, who have vanished from their usual gathering places since the trial started in July, say the risk of further government crackdowns on their community is too great to mount any mass protest.
Ahmed, a gay student at Cairo University willing to give only his first name for publication, said the crackdown on Cairo's gay community began early this year with a series of government sting operations directed by the State Security Intelligence Office. The government acknowledges that the intelligence office conducts such sting operations.
An associate of Ahmed, who asked not to be named, said he had met with an undercover policeman after answering an Internet query. When he was subsequently thrown in jail, he said he was raped repeatedly be cellmates.
Homosexuality, while still taboo in modern Egyptian society, is partially accepted in many circles, particularly in the lower classes but increasingly in the middle and upper classes, says Hashem Bahri, an Egyptian psychiatrist and fellow at Johns Hopkins University in the US.
"We had gone from a society of 'don't ask, don't tell,' to people asking their friends if they were gay and many gays openly admitting it," he says.
Dr. Bahri says he is concerned that the Queen Boat trial may force Egypt's gay community underground and make information on AIDS less available, putting homosexuals in greater danger of contracting the HIV virus through unsafe sex.
But conservative Egyptian judicial officials, backed with the moral authority of the country's Islamic leaders, fear that that Western influences on Egypt are undermining traditional gender roles, family values, and sexual morality. Government prosecutors in the Queen Boat trial say that homosexuality is mostly an outside Western influence that cannot and should not be tolerated.
Homosexuals in Egypt vehemently dispute claims that homosexual behavior derives from outside influences. They argue that gay lifestyles have a history in Egypt as old as the writings on the walls of its ancient tombs. While the Koran condemns homosexuality outright in several passages, Muslim societies have shown through much of their history a tolerance for same-sex relations.