The suspect's gun, a 9mm Glock 17, had been stolen from police in 2013, Commissioner Richard Ross said.

The suspect, 30-year-old Edward Archer, told homicide investigators he "pledges his allegiance to Islamic State, he follows Allah, and that is the reason he was called upon to do this," Captain James Clark revealed.

Archer wore "Muslim garb," a law enforcement source told Fox News. The source would not elaborate.

Officer Jesse Hartnett was in critical but stable condition at a hospital, police said. The suspect fired a total of 13 shots Thursday night, Ross said. Three bullets struck the officer in his left arm.

We are grateful for the outpouring of support for our brave officer,Jesse Hartnett.Please keep him in your thoughts & prayers as he recovers

FBI and other law enforcement investigators searched his homes Friday, according to police. They say the suspect has addresses in Philadelphia and the suburb of Yeadon. He did not reveal whether he was engaged in a larger "conspiracy," Ross told reporters.

Police officials say the gun was reported stolen from an officer's home in October 2013 but they don't know how many people handled the weapon before Thursday's shooting.

"We are working side-by-side with the Philadelphia Police Department. They remain the lead agency as we work together to gather information about the attack on their officer," the FBI announced.

Hartnett is a four-year veteran of the Philadelphia Police Department.

"This is absolutely one of the scariest things I've ever seen," Ross said at a news conference a few hours later. "This guy tried to execute the police officer. The police officer had no idea he was coming."

The suspect ran away, but was quickly apprehended by other officers roughly a block away.

In a statement, Governor Tom Wolf said, "This alleged intentional act of violence against an officer seeking to help a fellow citizen is horrifying and has no place in Pennsylvania."

Jim Kenney, who is in his first week as mayor of the nation's fifth largest city, said, "There are just too many guns on the streets and I think our national government needs to do something about that."

His statement comes on the heels of President Barack Obama announcement on Tuesday of his plan to tighten control and enforcement of firearms in the United States.