MANHATTAN (PIX11) — The man accused of attacking three NYPD officers near Times Square on New Year’s Eve confessed to wanting to kill cops and to carry out Jihad, a holy war on the behalf of Islam, prosecutors said Wednesday.

Trevor Bickford, 19, was charged with three counts of attempted murder and three counts of assault during his arraignment Wednesday morning. The proceeding was done from the hospital where Bickford is recovering from a gunshot wound.

The three officers were attacked around 10:10 p.m. at the intersection of 52nd Street and Eighth Avenue, about eight blocks from Times Square. One of the officers suffered skull fractures and the other two had lacerations to the head and body, prosecutors said.

“I wanted to kill an officer in uniform,” Bickford said, according to a criminal complaint.

Bickford is belied to have ties to radical Islamic extremism and allegedly said “Allauh Akbar” before hitting the cop over the head with a knife, prosecutors said. Authorities said the suspect, a Maine resident, wanted to travel across the country to carry out a Jihad and targeted government officials because they support Israel.

“I saw the officer and waited until he was alone. I said Allauh Akbar. I walked up and hit him over the head with a kukri (knife). I charged another officer but dropped the knife,” he said, according to the complaint.

Prosecutors said Bickford dropped the knife because he wanted to grab the other officer’s gun so he can kill him, but he was unable to get it out of the cop’s holster. One of the cops shot Bickford in the shoulder during the incident, police said.

“I tried to get the police officer’s gub but couldn’t,” Bickford said, according to the complaint.

Bickford is due back in court Friday. He is being held without bail and is being represented by the Legal Aid Society.

“Trevor Bickford, who is just a teenager, has no prior contact with the criminal legal system … For now, we ask the public to refrain from drawing hasty conclusions and to respect the privacy of our client’s family,” the Legal Aid Society said in a statement.