© Almasry Alyoum, via European Pressphoto AgencyMohamed Morsi, the president who was ousted by the military in July, on Tuesday in Cairo.
Mohamed Morsi, the deposed Egyptian president, appeared in public on Tuesday for the second time since his detention after the military takeover in July, this time locked in a soundproof glass cage as the defendant at a criminal trial.

The installation of the cage, a novelty in Egyptian courts, underscored the extent of the effort by the new government to silence the former president and his fellow defendants, about 20 fellow leaders of the Muslim Brotherhood. It dominated the courtroom debate, with lawyers for the defendants arguing that it deprived the accused of their right to hear or participate in their own trial and supporters of the government crediting the soundproof barrier with preserving order in the court.

"The glass cage was the hero of today's trial," Egyptian state television declared.

For his first appearance, at another trial in the same makeshift courtroom in November, Mr. Morsi insisted on wearing a dark business suit instead of the customary white prison jumpsuit, and then stole the spotlight by disrupting the proceeding. He shouted from the cage, which was not soundproof, that he was the duly elected president and the victim of a coup, and his fellow defendants shut down the trial by chanting against military rule.

Appearing on Tuesday in ordinary prison dress, Mr. Morsi passed his cage angrily and bided his time for a chance to speak again. When the judge turned on the microphone so that Mr. Morsi could acknowledge his presence, he shouted out, "I am the president of the republic, and I've been here since 7 in the morning sitting in this dump," according to an account on a Brotherhood website that was confirmed by people who had been present.

"Who are you?" Mr. Morsi asked the judge. "Do you know where I am?"

He insisted he did not recognize the court's authority to try him, in part since it was outside the constitutional procedures for impeaching a president.

The judge, Shaaban el-Shamy, shot back, "I am the president of Egypt's criminal court!" He turned off the microphone in Mr. Morsi's cage, and the ousted president was silenced.

The other Islamist leaders on trial in the same case were kept in a separate glass cage, presumably to prevent communication. At times, they turned their backs to the court in defiance. When the microphone was on so the judge could ask a question, they returned to chanting against military rule.

Shortly before the session began, Egyptian state television canceled plans to broadcast it, ultimately showing only limited clips later in the day. No other news organization was allowed to report live from inside the court during the hearing, and many, including The New York Times, were excluded from the session altogether.

Mr. Morsi, who was chosen as Egypt's first elected president in June 2012, was removed from office a year later in a military takeover after widespread street protests. The new government installed by Gen. Abdul-Fattah el-Sisi described Mr. Morsi's removal as a second revolution, after the 2011 revolt that ousted President Hosni Mubarak.

The military held Mr. Morsi and his top advisers incommunicado for months after army removed him from office. Prosecutors later began filing charges against them, including several punishable by death. In his first trial, which began in November, Mr. Morsi and other Brotherhood leaders were accused of inciting their supporters to kill protesters in street fights against their opponents outside the presidential palace in December 2012. (The police had refused to protect the Brotherhood from attackers, and the Brotherhood asked its civilian supporters to do it themselves.)

On Tuesday, Mr. Morsi and the other defendants faced other charges related to his escape from prison during the 2011 revolt, when he and other Brotherhood leaders were held in extralegal detention because of their opposition to Mr. Mubarak. They are now accused of conspiring with foreign militant movements, including the Sunni Islamist Palestinian group Hamas and the Shiite Lebanese group Hezbollah, to break themselves out.

Many rights advocates consider the charges implausible, to say the least. None of the foreign militant leaders named in the case were present for the trial, and at least one of the defendants from Hamas was deceased at the time, while a third was in an Israeli jail, according to news reports from that time, as well as Hamas.

Allowed to speak briefly later in the afternoon, Mr. Morsi addressed the judges. "I have the utmost appreciation for judges, and I say to them: Stay away from politics," he said, according to the website of the state newspaper Al Ahram.

"The procedures of my trial are invalid because I'm a legitimate president of the country," he insisted.

After removing Mr. Morsi, the new government began a widening crackdown on his Islamist supporters. Security forces have killed more than a thousand people at protests against the takeover and jailed thousands more, including almost all of the Brotherhood's top leaders. The government has shut down virtually all the Egyptian news media sympathetic to the group. In December, it banned the Brotherhood as a terrorist group.

In response to the takeover, there has been an escalating series of attacks on security forces, with two more in the capital area on Tuesday alone. Two gunmen on a motorcycle assassinated Gen. Mohamed Said, a senior Interior Ministry official, near his home in an area across the Nile River from Cairo, state news media reported.

Later, gunmen killed a policeman outside a Coptic Christian church in a suburb of Cairo, state news media reported.

In September, militants attempted to assassinate the interior minister, Mohamed Ibrahim, by detonating a car bomb near his motorcade. In November, gunmen killed Lt. Col. Mohamed Mabrouk, of the Interior Ministry division monitoring Islamist groups, in the Nasr City neighborhood of greater Cairo. And last weekend, on the eve of the anniversary of the uprising, four bombs exploded near police positions around Cairo, killing at least six people.

The Sinai-based militant group Ansar Beit al-Maqdis claimed responsibility for the killing of the general on Tuesday. It has claimed responsibility for most of the major attacks, including the biggest bombing over the weekend and the attempted assassination of the interior minister.

Correction: January 28, 2014
An earlier version of this article misquoted part of Mohamed Morsi's statement acknowledging his presence at the second session of his trial. He said "I have been absent from the world since the fourth of July," not "I have been absent from the world since the fourth of January."