Egypt's military officials have moved swiftly to prosecute protesters they blamed for an attack on the defence ministry, in an attempt to put down increasingly violent protests against their authority just weeks before the country's presidential election.
The fierce street battles on Friday raised to new heights the tension between the generals, who assumed power after Hosni Mubarak stepped down last year, and their critics, predominantly secular and liberal groups but now spearheaded by hard-line Islamists.
At least a hundred protesters have been killed in violent confrontations with security agencies since Mr Mubarak's ousting. But the military's response to Friday's demonstration near its headquarters was significant in how swiftly they moved to detain protesters.
Military prosecutors interrogated hundreds of demonstrators, referring some 300 of them to 15 days detention pending investigation into accusations of attacking troops and disrupting public order, a prosecution official said.
At least two detainees face accusations of killing a soldier in Friday's violence, the official said.
Political tension between the ruling generals and different groups in Egypt has been building during an election run-up marred by legal pitfalls, a lack of clarity in the authorities of the next president and a growing fear among activists that the military is seeking to back a candidate it can trust to preserve its economic interests and a special political role in the future.
Secular forces have accused the generals of seeking to cling to power; but Islamists have only recently joined the chorus. After issuing warnings against approaching the defence ministry, the military was quick to react when protesters tried to break through the barbed wire.
Police forces used water canons, tear gas and live ammunition to break up the crowd. Hundreds were detained in a security crackdown as the protesters dispersed.
As Islamists increasingly feel they are losing out in the jockeying for power, some of them have become louder in their criticism of the military generals. Two prominent Islamist presidential candidates were disqualified from the race on technical grounds. The ultraconservative candidate was disqualified because his mother held dual Egyptian-American nationality, a violation of the law.
The powerful Muslim Brotherhood's candidate was disqualified because of a previous political conviction under Mr Mubarak's rule, also a violation. The group, which won nearly 50% of the parliament seats, is fielding another candidate but they have been frustrated with translating their parliament success into political power.