An Egyptian policeman stands guard

Egyptian police have killed three top Islamist militants in two separate operations, including two caught trying to move to a new hideout on Cairo's outskirts, the government said Tuesday.

The interior ministry said the two militants killed in New Cairo were senior members of the Hasam group -- an extremist movement the government accuses of links to the outlawed Muslim Brotherhood.

The third man, a jihadist who was gunned down in the restive North Sinai province, was a leader of a militia affiliated with the Islamic State group, the ministry said in a separate statement.

In the first operation, authorities had acted after learning that some of Hasam's leaders were about to move "equipment and weapons" to a new hideout in New Cairo, outside the capital's ring road, the ministry said.

Security forces set up checkpoints on roads to the area and as forces approached a suspect car, "its passengers opened fire" on police and were killed in retaliatory fire.

The two were identified as students aged 24 and 21 who were "among the most prominent leaders in the Hasam terrorist group," the ministry said.

In the vehicle, police found seven automatic weapons, two other firearms, a large amount of ammunition, masks and radio equipment.

The ministry did not say when the shootout took place, but said the group had been planning to move locations on Tuesday.

The militants who died were said to have been behind attacks including a shootout in early May in which three policemen were killed and five wounded near the Cairo ring road.

The pair had carried out attacks on the orders of "their leaders who have fled abroad," the ministry said.

The government says Hasam is linked to the Muslim Brotherhood movement of former Islamist president Mohamed Morsi who was overthrown by the army in 2013.

The militia has previously claimed responsibility for deadly attacks against security forces as well as assassination attempts targeting a pro-government Muslim cleric and Egypt's deputy prosecutor general.

The group said on Twitter Monday it has killed 27 people from "military occupation militias", a reference to Egypt's security forces, since its launch a year ago.

Egypt has been fighting an insurgency by an IS affiliate which is based in North Sinai province, where hundreds of soldiers and policemen have been killed since Morsi's ouster.

Following deadly church bombings claimed by IS, on April 10 President Abdel Fattah al-Sisi declared a three-month state of emergency, which has since been extended.

In North Sinai on Tuesday, security forces killed Ahmed Hassan Ahmed al-Nshou, a senior member of IS's Egyptian affiliate, in a gunfight, the ministry said in a separate statement.

Police raided a house in the provincial capital El-Arish and came under fire before shooting back and killing Nshou.

Security forces are trying to track down another militant who fled the scene, the ministry said.

Source: AFP