Two army personnel were killed in a shootout with "terrorist elements" in the Nile Delta on Wednesday morning.
A combined team of police and soldiers raided a terrorist hideout in Al-Kanater Al-Khayreya in Qalioubiya governorate, a security source told state news agency MENA.
Two army explosives experts – General Maged Ahmed Saleh and Colonel Maged Ahmed Shaker - and six islamic militants were killed in the resulting gunfight, the head of Qalioubiya security directorate told Al-Ahram Arabic news website.
Attacks on security and army forces have intensified since the ouster of Islamist president Mohamed Morsi in July 2013, leaving dozens killed.
While militant attacks, explosions and drive-by shootings first broke out in the restive Sinai Peninsula, in late 2013 violence spread to other governorates, including the capital.
The army and police have launched a crackdown on militants leaving hundreds dead, mainly in Sinai.
Egyptian authorities have continued to blame the Muslim Brotherhood, of which Morsi was a leading member, for orchestrating the attacks.
In December, the interim authorities declared the Brotherhood a terrorist organisation, a decision upheld by a court order in February.