Egypt's military on Saturday ordered 300 people detained afterdeadly clashes between troops and anti-army protesters in Cairo and imposed a new curfew, as tensions spiral ahead of a key presidential poll.

The arrests were announced as the country's ruler Field Marshal Hussein Tantawi attended an unprecedented public funeral for a soldier killed in the clashes.

Military prosecutors said the 300, including nine journalists, "will be held for 15 days pending investigation" into clashes in theAbbassiya district on Friday that left two people including a soldier dead and at least 300 injured.

Hours later, a military source told AFP all the women detained will be released.

"The military judiciary has decided to release all the women," he said. He did not say how many women were detained but activists put the number at between 14 and 17.

The army also imposed an overnight curfew around the defence ministry for a second successive night, from 2100 GMT on Saturday until 0400 GMT on Sunday, a military source and state television said.

After hours of overnight questioning, those held were accused of assaulting army officers and soldiers, assembling in a military zone and preventing members of the armed forces from carrying out their work, the source said.

They all denied the charges.

The clashes erupted just three weeks ahead of Egypt's first presidential election since a popular uprising ousted president Hosni Mubarak last year.

The Supreme Council of the Armed Forces (SCAF) has vowed to hand power to civilian rule when a president is elected.

But protesters believe the army wants to maintain a degree of power even after the election and fear the polls will rigged in favour of a pro-military candidate.

In Cairo, Tantawi attended the funeral of Samir Anwar Ismail, who died in the clashes.

Tantawi and his deputy Sami Enan joined the procession after the funeral prayer for Ismail, a member of a special forces unit, his comrades told AFP.

A horse-drawn carriage bore the coffin behind honour guards carrying wreaths as Tantawi, Enan and other SCAF members followed with the family of the dead soldier.

The military had in the past refused to disclose their casualties in clashes with protesters, saying it did not want to affect army morale.

But it made an exception with Ismail because "his death at the hands of protesters represents a clear attack on the army," an officer told AFP.

Media called for an end to the violence, with state-owned newspapers urging protesters to confine their demonstrations to Tahrir Square -- the epicentre of the uprising that toppled Mubarak.

"Tahrir is calling Abbassiya: go back to the square," the state-owned Al-Gomhuriya said on its front page.

"Enough Blood," said the government owned Al-Akhbar.

By Saturday morning, after an overnight curfew ended at 0500 GMT, protests had subsided in the defence ministry area, with soldiers and armoured personnel carriers blocking off a road to the ministry.

Officials at Al-Zahra University hospital said on Friday they received two people killed in the ministry clashes.

The health ministry said only the soldier died, while at least 296 people were hurt, including 131 who needed hospital treatment.

Earlier on Friday, military police had charged the protesters, chasing them down side streets near the ministry on foot and in military vehicles, firing birdshot and assault rifles into the air amid chaotic scenes.

Thick smoke engulfed Abbassiya square, where several thousand secular and Islamist protesters had gathered.

The clashes began when some protesters threw rocks at the military police.

The unrest comes ahead of the landmark presidential poll amid fears by many Egyptians that the military rulers will renege on a pledge to hand power to civilian rule after the election and that the vote will be rigged.

"We are here to end SCAF rule. We don't trust them. SCAF is following Mubarak's example, and we want to protect the revolution," said Mohammed Badawi from Ismailiya, a member of the Coalition of Revolution Youth.

The Abbassiya neighbourhood witnessed deadly clashes just two days earlier, which the health ministry said left at least nine people dead, although field medics say more died.

On Wednesday, unknown attackers also stormed a sit-in near the defence ministry by supporters of Salafist politician Hazem Abu Ismail, after he was disqualified from the presidential race.

Other candidates include former Arab League chief Amr Mussa and Mubarak's last premier Ahmed Shafiq.

The powerful Muslim Brotherhood has fielded the head of its political arm Mohammed Mursi whose main Islamist rival is Abdel Moneim Abul Fotouh, a former Brotherhood member.

The presidential election is scheduled for May 23 and 24 with a run-off for June 16 and 17 if there is no outright winner.