Updated

Egypt's military officials moved swiftly Saturday to prosecute protesters they blamed for an attack on the Defense 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, predominently 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 Mubarak's ouster. 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 Saturday.

At least two detainees face accusations of killing a soldier in the Friday 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 defense 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.

Tensions started to brew a week ago. Protesters, predominantly supporters of an ultraconservative presidential candidate who was barred from the election, held a sit-in outside the ministry starting last Saturday.

Deadly clashes broke out when apparent supporters of the military rulers attacked the crowd Wednesday.

Nine people were killed in those clashes, which drew in antimilitary protesters from different revolutionary groups. They called for a rally Friday, demanding the generals stick to their pledges to step down after the election.

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 Mubarak's rule, also a violation.

The group, which won nearly 50 percent of the parliament seats, is fielding another candidate but they have been frustrated with translating their parliament success into political power.

The group organized a parallel rally on Friday in Tahrir Square, refusing to join the march on the Ministry of Defense. But on Saturday, it criticized the military authorities' quick move to prosecute those who attacked their headquarters while doing little to prosecute those who killed civilians near the ministry on Wednesday.

The Brotherhood described it as "astonishing and surprising."

The tension between the military and Islamist critics has given the ruling military council a chance to sway public opinion to its side. Many secular and liberal Egyptians fear the growing power of Islamists, and many see the military as the only institution that can lead the country's transition to democracy.

On Saturday, the state-controlled media focused on the Islamist role in the violent clashes, replaying images of bearded young men and women removing the barbed wire, throwing stones, and gesturing at the troops.

An analyst hosted by state TV said the protesters against the military were "traitors" to the nation.

The circumstances surrounding the deadly clashes on Wednesday remain unclear.

Residents and activists said some of the protesters were armed and provoked the situation.

Islamist protesters said the assailants were hired thugs or plainclothes security. They blamed the military for doing nothing to stop the fighting and said authorities planted armed people among them to frame them for the violence.

A military official said the dead soldier was shot by someone inside the mosque. He was speaking on condition of anonymity according to military regulations.

The official said a curfew will remain in place again Saturday around the ministry.

In an apparent good will gesture, the military general prosecutor Adel el-Morsi ordered the release of all female detainees rounded up following the clashes. El-Morsi didn't give a reason, but troops have previously been criticized for targeting female protesters.