Police say the suspect in the shooting of a Philadelphia police officer told investigators that he shot the officer in the name of Islam and pledged allegiance to the Islamic State group.
They also say the man, who has addresses in Philadelphia and the suburb of Yeadon, used a stolen police gun in the crime.
The gunman ambushed a police officer as he sat in his marked cruiser at an intersection, striking him three times in the arm during a barrage of bullets and fleeing before being apprehended, officials said Friday.
Police Commissioner Richard Ross said the suspect fired at least 13 shots late Thursday as he walked toward Officer Jessie Hartnett and eventually got up next to the car and reached through the driver's-side window.
The officer returned fire, hitting his attacker at least three times. Hartnett was in stable condition.
"I don't know how this officer survived," Ross said.
This is absolutely one of the scariest things I've ever seen," the commissioner said. "This guy tried to execute the police officer. The police officer had no idea he was coming."
The officer's father, Robert Hartnett, said his son was in good spirits.
"He's a tough guy," he said.
Hartnett, 33, had served eight years in the Coast Guard and joined the police five years ago. He always wanted to be a police officer, his father said.
"I'm bleeding heavily!" Hartnett shouted into his police radio when he called in to report shots fired.
The suspect ran away but was quickly apprehended by other officers, authorities said.
Ross, who was sworn in as commissioner Tuesday, said there was no apparent motive for the attack.
"Why someone would do something so absolutely evil is just beyond us," Ross said.
There was no immediate word on the suspect's condition. Officer Christine O'Brien said the man was stuck at least once in the buttock.
Jim Kenney, 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's announcement Tuesday of his plan to tighten gun control laws.