"Three terrorist elements fired on Brigadier General Hisham Mohammed Mahmud, one of the heroes of the armed forces, outside his home in El-Arish after prayers, resulting in his martyrdom," the spokesman said on Facebook.
The army has been battling an Islamist insurgency in northern Sinai which escalated after the military overthrew Islamist president Mohamed Morsi in 2013.
Egypt's government says hundreds of police and soldiers have died in the attacks, which have also hit Cairo and the Nile Delta.