Five policemen, including three officers, were also injured in the shootout, he said.
Police raided two apartments in Ard Ellewa district on a tip-off that terrorists were hiding there and preparing to launch attacks, the state-run MENA news agency reported.
When the police forces approached to the apartment, terrorists opened fire on them, the official said.
Ten terrorists were killed in the exchange of gunfire, he said.
A huge cache of arms and ammunition was also recovered by the police.
Terrorist attacks, mainly targeting police and military, increased after the ouster of Islamist president Mohamed Morsi in 2013 by military following massive protests against his rule.
Hundreds of police and army personnel have been killed since then.