A man being chased by police detonated explosives near Cairo's Al-Azhar Mosque, killing himself and two of the officers, the Egyptian Interior Ministry said Monday.

Three other police were wounded in the blast, which occurred at around 9.00 pm.

Police had previously identified the man as the perpetrator of an attempted bombing last Friday at another mosque in the capital, Al-Istiqama, just as worshippers were leaving after mid-day prayers, the ministry said in a statement.

Security forces established a perimeter around the crime scene in the Gamaliya district of central Cairo, which includes the well-known Khan el-Khalili tourist marketplace as well as Al-Azhar.

When police caught up to the suspect, "one of the explosive devices in his possession exploded, causing the death of the terrorist and the martyrdom of a police officer from national security and an officer from Cairo investigations (department)," the Interior Ministry said.

The Egyptian army said over the weekend that troops killed seven "terrorists" in the northern Sinai peninsula following an attack by militants.

While Egyptian officials offered no details on the original attack, other Arab governments offered condolences to the families of 15 people killed and wounded.

A police officer died on Jan. 5 as he tried to deactivate a bomb discovered near a Christian church in Cairo just two days ahead of the Coptic Christmas.

That incident came a week after the deaths of three Vietnamese tourists and their Egyptian guide when a bomb went off a tour bus en route to the Giza Pyramids on the outskirts of the capital.

The Giza blast was Egypt's first attack against tourists using explosives since late 2015, when a bomb blew a Russian airliner out of the skies above Sinai, killing all 224 people aboard.

Egypt responded to the Giza incident with raids near Cairo and in Sinai that resulted in the deaths of 40 suspected extremists.

This nation of nearly 100,000 people has been under a state of emergency since April 2017, following a series of terrorist attacks against Coptic Christian churches in the Nile delta.

The Egyptian affiliate of Islamic State has claimed responsibility for most of the terrorist activity in the country during the last five years.