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 ISIS 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 US Muslim advocacy group said it had found no evidence that Archer was an observant Muslim.
US officials have been on high security alert following a series of ISIS-linked attacks at home and abroad over the last few months.
In November, gunman and suicide bombers affiliated with ISIS 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 ISIS.
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 last 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 US 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.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.