Two members of Egypt's most active Islamist jihadist group, Ansar Beit El-Maqdis were killed during a gunfight near Cairo late Thursday, the country's official news agency reported.
Three policemen and two civilian passersby were also wounded in the shootout.
The run-in took place in El-Salam City, on the eastern outskirts of the capital, MENA reported, citing an unnamed source in the interior ministry.
The men are among "the most dangerous" members of Ansar Beit Al-Maqdis – which swore allegiance to the Islamic State in November, the official said.
Egypt's military is battling an Islamist insurgency, primarily based in the Sinai Peninsula, which has targeted police and security forces since the 2013 ouster of Islamist president Mohamed Morsi.
The alleged militants were involved in violent attacks on security forces, the source added.
The incident occurred when armed men opened fire at security forces after they had attempted to stop their car at a security checkpoint, a security source said earlier, MENA reported.
Two of the men were killed in the shootout while two others fled the scene, the source added.
Also on Thursday, two military troops were killed when a roadside bomb struck an army vehicle in the Sinai Peninsula.