Police car
Police cariStock

A string of shootings in Pennsylvania Friday were acts of terror, the Department of Homeland Security announced Sunday.

On Friday, a 51-year-old man opened fire on law enforcement officials just yards away from the state Capitol building in Harrisburg, Pennsylvania.

The gunman fired at Capitol Police car, then shot and wounded a nearby state trooper.

Police later managed to kill the gunman.

Police identified the shooter as Ahmed Aminamin El-Mofty, a legal immigrant who received citizenship via what is often called “chain migration” – whereby naturalized immigrants living in America are able to sponsor the immigration of relatives living abroad.

DHS officials called the shootings a “terror attack”, though declined to state whether El-Mofty was a member a known terror organization, CNN reported.

DHS Acting Press Secretary Tyler Houlton said the incident highlight the “Trump administration’s concerns with extended family chain migration”.

"Both chain migration and the diversity visa lottery program have been exploited by terrorists to attack our country," Houlton said.

"The programs make it more difficult to keep dangerous people out of the United States and to protect the safety of every American."

El-Mofty’s country of origin has yet to be publicized, though Dauphin County District Attorney Ed Marsico said El-Mofty’s estranged wife was originally from Egypt. Marsico added that El-Mofty had recently visited the Middle East, “as recently as October,” but did not specify which country El-Mofty had visited.