It said the attacker had first fired at a shop 4 km (3 miles) away, killing two people, before proceeding to the Mar Mina church in the southern suburb of Helwan, where he opened fire and tried to throw an explosive device.
Authorities reported at least nine people dead, among them three police officers.
At least two Egyptian police officers were killed on Friday in an attempt to prevent an attack on a church in the Cairo suburb of Helwan, local media reported citing police sources.
A video circulating on social media after Friday's attack apparently showed the gunman lying on the ground with his face covered in blood. As security forces have become more hard to target, it has increasingly attacked civilians instead.The latest attack comes a day after six Egyptian soldiers were killed in a roadside bombing in the Sinai.
"It's more continuity than change, we still need more details to come up, but so far Egypt has witnessed over 2,000 attacks in the last three years", he told Al Jazeera. No group has claimed responsibility for the attack. On Palm Sunday in April, terrorists staged an explosion in the main church of the city of Tanta, where about 30 people died. The demonstrators shouted anti-Christian slogans and called for the church's demolition, according to the local diocese.
Hundreds of Egyptian Christians flee their homes in the northern part of the Sinai Peninsula, fearing attacks by Islamic State militants.
They announced plans to deploy rapid-reaction forces and electronic jamming equipment earlier this week to protect festivities around the New Year and Coptic Christmas on 7 January.
A Muslim mob ransacks and torches seven Christian homes in Minya after rumors spread that a Christian man had an affair with a Muslim woman. Attacks pick up in the aftermath of Egypt's Arab Spring uprising that begins weeks later, then even more so after the army overthrows an elected but divisive Islamist president in 2013.