Terrorists killed at least 30 policemen and injured eight in a shootout during a raid on Friday on a militants' hideout southwest of Cairo, officials said. No militant group immediately claimed involvement in the firefight.
The exchange took place in the al-Wahat al-Bahriya area in the Giza governorate, about 135 kilometers (84 miles) from the Egyptian capital, after security services received information on the militants' location, the official said.
The Ministry of Interior said in a statement that a number of policemen were killed and injured, and some terrorists also died in the ensuing crossfire.
Egypt's Grand Mufti Shawki Allam condemned the killing in a statement.
Egypt has been struggling to contain an insurgency by Islamic militants led by an affiliate of the Islamic State group, centered mostly across the Suez Canal, in the northern region of the Sinai Peninsula, but attacks on the mainland have also recently increased.
The country has been under a state of emergency since bombings and suicide attacks targeting minority Coptic Christians killed scores earlier this year. Those attacks were claimed by the Islamic State group.
Terrorist attacks, mainly targeting police and military, increased after the ouster of former Islamist president Mohamed Morsi in 2013 by military following massive protests against his rule.