Gehad el-Haddad, a senior Brotherhood official, defended the group’s decision to call on its members and other Islamist supporters of the president to defend the palace from a potential attack by the protesters. He said Mr. Morsi could not rely on the police force left over from Mr. Mubarak’s government. By keeping the protesters from trying to storm the palace walls, Mr. Haddad contended, the Brotherhood and the president’s supporters had prevented a bloodier conflict with the armed presidential guard. “We will protect the sovereignty of the state at any cost.”

Both sides that night were violent, and the use of force by the Brotherhood’s opponents appears to have been deadlier, though that is hard to corroborate given the fog of the moment. Brotherhood leaders have named eight members of their organization who died that night. Mr. Haddad said one friend who was next to him was shot in the neck and died in the street. Although one journalist is in a coma from wounds received during the battle, human rights advocates say they do not yet know of any deaths on the opposition side.

But some contend that the Brotherhood, Egypt’s largest Islamist group, provoked the violence by summoning supporters and other Islamists to defend the palace from a planned protest.

“God willing, members of the Freedom and Justice Party will be on the front line,” Essam el-Erian of the party, affiliated with the Brotherhood, wrote in an Internet message to supporters.

Later, when the battle began, he declared on the Brotherhood’s television network, “This is the opportunity to arrest them and reveal the third party which is behind the shooting of live ammunition, and the killing of protesters.”

After nightfall, thousands of Islamists and their secular opponents battled over several blocks with volleys of rocks and gasoline bombs punctuated by occasional shotgun blasts. The riot police were on hand throughout, but did little to intervene.

Mr. Haddad, who was behind the Islamist lines, said the detentions began after Brotherhood leaders ordered their members to build and push forward a makeshift barrier to clear a space in front of the palace. “They realized that there were thugs on our side with knives and actual shotguns, shooting sideways,” he said, describing attackers who came from the opposition.