CAIRO — A gunman on a motorcycle opened fire Friday outside a church in a Cairo suburb and at a nearby store, sparking a shootout that killed at least nine people, including eight Coptic Christians, authorities said. It was the latest attack targeting Egypt’s embattled Christian minority.

The gunman was also killed, along with at least one police officer, officials said.

The local affiliate of the extremist Islamic State group claimed responsibility for the attack late Friday, saying it was carried out by a “security detail” and that one of its men was “martyred” in the strike. The claim was carried by the group’s Aamaq news agency.

The attack began when the gunman tried to break through the security cordon outside the Coptic Church of Mar Mina. It was not clear how many assailants were involved. Egypt’s Interior Ministry referred to only one, but the Coptic Orthodox church mentioned “gunmen.”

Five people were wounded, including another police officer, Health Ministry spokesman Khaled Megahed said.

The attack came amid tightened security around churches and Christian facilities ahead of the Coptic Orthodox Christian celebrations of Christmas on Jan. 7. Police have been stationed outside churches and in nearby streets across Cairo. President Abdel-Fattah el-Sissi has personally chaired meetings with his top security chiefs in recent days to discuss security during New Year’s Eve and the Orthodox Christmas.

President Donald Trump spoke with Egypt’s president after the attack, condemning it and reiterating “that the United States will continue to stand with Egypt in the face of terrorism.”

“President Trump emphasized his commitment to strengthening efforts to defeat terrorism and extremism in all their forms,” a White House statement said. Trump has promised to make protecting beleaguered Christian communities overseas a priority for his administration.