A man claiming allegiance to Islamic State militants was charged on Saturday with attempted murder in the shooting of a Philadelphia police officer this week, the prosecutor said.
Edward Archer, of Philadelphia, is accused of ambushing an officer in his squad car shortly before midnight on Thursday.
He is also charged with several other crimes and is being held without bond, the Philadelphia District Attorney's Office said on its Twitter account.
Police released still images from surveillance video that showed the gunman dressed in a long white robe walking toward the car and firing, eventually getting close enough to shoot at point-blank range through the window.
The city's police commissioner said on Friday that Archer told authorities he ambushed the patrol car "in the name of Islam."
"He has confessed to committing this cowardly act in the name of Islam," Richard Ross told a news conference, adding that the 30-year-old assailant also referenced Islamic State militants.
There was no evidence as yet that the shooter had worked with anyone else, Ross said, adding, "He was savvy enough to stop just short of implicating himself in a conspiracy."
A top U.S. Muslim advocacy group said it had found no evidence that Archer was an observant Muslim.
U.S. officials have been on high security alert following a series of Islamic State-linked attacks at home and abroad over the last few months.
In November, gunman and suicide bombers affiliated with Islamic State killed 130 people in a series of attacks in Paris. Last month a married couple fatally shot 14 people in San Bernardino, California, in an attack inspired by Islamic State.
Those concerns have led to calls by some Republican governors and presidential hopefuls to restrict the admission of Syrian refugees fleeing that country's long civil war.
Philadelphia Mayor Jim Kenney, a Democrat sworn in on Monday, said after the shooting he did not believe Archer's actions reflected Islamic thinking.
"In no way, shape or form does anyone in this room believe that what was done represents Islam," Kenney said. "This was done by a criminal with a stolen gun."
The Council on American-Islamic Relations, the leading U.S. Muslim advocacy group, on Friday said Archer "does not appear" to be an observant Muslim.
At the Masjid Mujahideen mosque, which stands around the block from the home where Archer was believed to have lived, Imam Asim Abdur-Rashid said he did not know Archer and was not aware if he had ever prayed there.
(Reporting by Brendan O'Brien; Editing by Frank McGurty and Clarence Fernandez)