Two Egyptian army officers were killed on Wednesday in a shootout with Islamist militants, security sources said.
The exchange of gunfire erupted after an army colonel and brigadier general took part in a raid on a militant safehouse where the men were hiding in Qalubiya province, north of Cairo, the sources said.
Security sources said earlier the two officers were colonels but the army spokesman's Facebook page gave a different version of ranks.
The two officers were bomb disposal experts, the security sources said.
Islamist militants based in the Sinai peninsula near Israel's border have stepped up attacks on security forces since the army chief toppled President Mohamed Mursi of the Muslim Brotherhood last July. Hundreds have been killed.
The Islamist insurgency has spread to other parts of the Arab world's biggest nation, including the capital Cairo.