CAIRO -- Egyptian police have killed a top commander of a local Islamic State affiliate in a Cairo raid, the Interior Ministry said Monday.

Ashraf Ali Hassanein Gharabli died in a firefight that erupted when police tried to arrest him on Sunday in the capital's El-Marg district, the statement said, adding that Gharabli had opened fire with a 9mm pistol when policemen approached him outside his car.

It said Gharabli was implicated in a series of militant attacks, including the beheading of a Croatian engineer last summer, the killing of an American oil worker a year earlier, and the July bombing of the Italian Consulate in Cairo, which killed one person and wounded at least 10.

The ministry said Gharabli attempted to assassinate the former Interior Minister Mohamed Ibrahim in 2013, and was behind the September kidnapping and killing of a guide in the Western Desert who the militants said had worked with security forces.

Egyptian security forces have for years battled an Islamic insurgency based in the restive Sinai Peninsula, where a local Islamic State affiliate has claimed a series of attacks against police and military checkpoints. The fighting has surged since the army overthrew Islamist President Mohammed Morsi in 2013.