Updated

There's "no doubt" a gunman who fired at police in several locations in the state capital, wounding one of them before they shot and killed him, was targeting police officers, a prosecutor said.

Ahmed Aminamin El-Mofty fired at a Harrisburg police officer on Friday afternoon and later at a state trooper, wounding her before pursuing her, Dauphin County District Attorney Ed Marsico said.

"He fired several shots at a Capitol police officer and at a Pennsylvania state police trooper in marked vehicles," Marsico told reporters, flanked by state police, Capitol police and FBI officials.

The gunfire began shortly after 4 p.m. Friday, when the man fired several shots at a state Capitol officer in downtown Harrisburg, striking his car several times and sending one shot "that went very close to hitting him," Marsico said. About 20 or 30 minutes later, he fired several shots at the state trooper, striking her with one of those shots.

The trooper is "doing well," is in good condition and is expected to make a full recovery, Marsico said.

El-Mofty pursued the trooper to a residential neighborhood, where city and state police encountered him.

"He approached them with two handguns ... firing many shots at those police officers," and the officers returned fire, killing him, Marsico said.

El-Mofty had ties to the Middle East and recently traveled there, but the motive for the attack was unknown, Marsico said.

Marsico asked for information from the public about the man, who also had ties to the city and its western suburbs across the Susquehanna River. He declined to comment on whether the man was known to police.

A relative, Ahmed Soweilam, told PennLive.com that he and his family doesn't know what to make of the reported actions by El-Mofty, his sister's ex-husband.

"That's not his behavior at all," said Soweilam, co-owner of a Halal store in Camp Hill. "That's not him. I still don't believe it."

Soweilam said the family had been estranged from El-Mofty, who had been married to his sister until they separated about six years ago. He said El-Mofty worked as a security guard and then moved back to Egypt, his former home, until returning a few months ago. He said El-Mofty had no history of violence or mental illness.

"He's not the perfect guy, but he's not an aggressive person," Soweilam said.

Democratic Gov. Tom Wolf said Saturday he had talked to the director of Homeland Security as federal, state and local law enforcement authorities investigate "last night's attack on law enforcement."

"I again want to thank officers who put themselves in harm's way to prevent further injury or loss of life," he said in a message on Twitter.

Marsico expressed gratitude to state and local police for bringing a rapid end to an episode he said could have been much worse.

"This could have been a really tragic incidence with this individual firing many shots at police cars in downtown Harrisburg in the midst of rush hour traffic on a Friday afternoon and then coming up here in a residential neighborhood and firing again many shots," he said.