Six Egyptian soldiers have been killed by gunmen at a checkpoint in the northern Cairo suburb of Shubra al-Khayma, state media reports.
A security official said two bombs left behind by the attackers had been defused.
The violence comes two days after another soldier was shot dead in an attack on an army bus in eastern Cairo.
There has been an upsurge in violence since the overthrow of Islamist President Mohammed Morsi last July.
Islamist militants have killed hundreds of police and soldiers in numerous attacks.
The military accused Mr Morsi’s Muslim Brotherhood of carrying out this latest attack, which was carried out as the soldiers took part in dawn prayers.
The Brotherhood denies involvement in violence, saying it is committed to peaceful campaigning.
It was designated a terrorist group in December and thousands of its members have been put on trial.
A series of high-profile attacks on security forces in Cairo and the Sinai peninsula have been claimed by another group, Ansar Beit al-Maqdis, which it says are in revenge for the military-backed government’s repression of Mr Morsi’s supporters.
Mr Morsi, elected in 2012 following the overthrow of veteran ruler Hosni Mubarak, was ousted by the military amid huge streets protests against him, after a year in power marred by deep political and social divisions.
Mr Morsi is in jail facing four separate trials. The charges, which he denies, include the killing of opposition protesters, espionage and conspiring to commit acts of terror.
Military chief Field Marshal Abdul Fattah al-Sisi is expected to stand in presidential elections which are due to be held in April.