At least nine people were killed on Friday when a gunman opened fire outside a Coptic church near Cairo, said the Egyptian Interior Ministry and church officials.
The gunman was wounded and later arrested in the incident.
The ministry said security forces had “immediately dealt with the (attacker) and arrested him after he was wounded.” It added, “Legal measures have been taken,” without elaborating.
Cairo’s state prosecutor said that an investigation has been launched into the incident.
“The shooting began at 10:30 a.m. and carried on for more than 15 minutes ... there was more than one attacker,” Mohammed Hussein Abdelhadi, who lives close to the church, told Reuters.
A witness who did not want to give his name said the policeman was killed while he was closing the church gate to stop the gunman getting in.
The church was being guarded by police in the run-up to Orthodox Christmas celebrations next week.
There was no immediate claim of responsibility for the attack. Militants have claimed several attacks on Egypt’s large Christian minority in recent years, including two bombings on Palm Sunday in April and a blast at Cairo’s largest Coptic cathedral in December 2016 that killed 28 people.
Earlier reports by security sources and state media said at least two attackers were involved, and that one was shot dead and another fled the scene. The interior ministry did not explain the reason for the different accounts.
The Coptic Church said the gunman first shot at a Christian-owned shop 4 km (3 miles) away, killing two people, before proceeding to the Mar Mina church in the southern Cairo suburb of Helwan. The Interior Ministry said he opened fire at the entrance to the site and tried to throw an explosive device.
Eleven people were killed in all, including a policeman at the church, according to Interior Ministry and Coptic Church accounts. The Church said a young woman had died later from her wounds, bringing the civilian death toll at the church to eight.
The ministry added that investigators had identified the gunman and that he had carried out several attacks since last year.
The health ministry said earlier that five people had been wounded, including two women who were in serious condition.
Samir Gerges, a witness to Friday's church attack, said people inside the church closed the gates when the shooting began but that some bullets penetrated the building. Gerges said he was walking along a nearby street when the gunfire broke out. He saw people running and some taking cover in a nearby restaurant.
Another witness, 40-year-old Raouth Atta, was praying inside the church when the violence broke out.
"People were terrified and wanted to check on their families in other buildings of the church," she told The Associated Press by phone. "We stayed inside for 30 minutes before we were able to get out."
"We kept praying," said Father Boules, who was teaching a class in the church complex. On hearing gunfire, he went to check on his students, who were panicking and terrified.
Security forces went on high alert for Christmas and New Year celebrations. Egypt is also grappling with a deadly ISIS insurgency in the North Sinai region.