Gunmen on a speeding motorcycle opened fire outside the plateau of the famed Giza Pyramids on the outskirts of Cairo on Wednesday, killing two members of the country's tourist police, Egypt's state news agency reported.

The drive-by shooting was a rare attack at a tourist site. The state MENA news agency said the gunmen fled the area and that an investigation was underway.

Egypt sees regular attacks on its security forces as it struggles with a low-level Islamist insurgency, mostly in the lawless northern Sinai Peninsula.

Story continues below advertisement

But the attacks have lately inched closer to the capital, mostly targeting individual security agents but have also included near-daily small bombings in public areas. A deadly car bombing last year hit the security headquarters in Cairo, killing four people and also damaging an Islamic museum across the street.

The surge in violence has followed the military's ouster in 2013 of Islamist President Mohammed Morsi and a crackdown on his group, the 87-year old Muslim Brotherhood, landing most of its leadership and thousands of its supporters in jail.

Militants say the attacks are meant to avenge the crackdown. Sinai-based Ansar Beit al-Maqdis — which has claimed most of the major attacks in Egypt — has pledged allegiance to the Islamic State extremist group fighting in Iraq and Syria and has declared itself to be the group's Sinai Province.

On Tuesday, authorities arrested two senior Brotherhood leaders, increasing pressure on the Islamist group at a time when its ranks are divided over whether to pursue a course of direct violent confrontation with the government in response to the nearly 2-year-old heavy crackdown.

Tourism, a major foreign revenue earner in Egypt, plunged recently, after recovering from a wave of Islamist attacks in the 1990s.