CAIRO — Held incommunicado for the four months since his overthrow as president, Mohamed Morsi of the Muslim Brotherhood walked into a makeshift courtroom on Monday for his new role as a defendant in a murder trial.

But Mr. Morsi, dressed in a blue suit, refused even to wear the usual all-white prisoner’s costume.

“I want a microphone so I can talk to you,” Mr. Morsi shouted three times from a special defendant’s cage constructed to obscure him from public view. “There is a military coup in the country,” he shouted, adding, “I am the president of the republic, according to the Constitution of the state, and I am forcibly detained!”

Repeatedly cited by the new government as evidence of its adherence to the rule of law, the trial instead threatened to embarrass its leadership, with the defendants and their lawyers seizing a rare platform to question the military takeover. Islamists around Egypt were galvanized by Mr. Morsi’s show of defiance as the judge failed to gavel him into silence and instead adjourned the trial for two months.