The Maine man accused of attacking three NYPD officers with a machete on New Year’s Eve has pleaded not guilty to state charges including terrorism and attempted murder.

Trevor Bickford, 19, entered the plea at his New York State Supreme Court arraignment on Wednesday.

An indictment the Manhattan district attorney’s office unveiled Wednesday charged Bickford with 18 counts related to the Dec. 31 attack in Times Square, including three counts of first-degree attempted murder in furtherance of an act of terrorism.

Bickford was charged with federal crimes in connection with the attack last month.

“Trevor Bickford allegedly carried out planned attacks on three members of the NYPD in Times Square on New Year’s Eve as they did their duty to protect our city,” Manhattan District Attorney Alvin Bragg said in a statement. “My thoughts are with the courageous officers as they continue to recover and heal.”

Prosecutors say the machete attack happened less than two hours before midnight on New Year’s Eve, just outside the area where people are screened for weapons before gaining entry to Times Square.

An NYPD officer was standing at the corner of West 52nd Street and Eighth Avenue around 10:10 p.m. that night when Bickford walked up to him and struck his head with a knife, fracturing his skull, prosecutors said.

Afterward, Bickford struck two other officers in the head with the knife, according to prosecutors. All three officers were hospitalized after the attack.

Federal prosecutors last month said Bickford allegedly became radicalized during the summer in 2022, reading radical Islamic literature that promoted the Taliban and the teachings of Abu Muhammed al-Maqdisi, who prosecutors described as "a spiritual mentor” of al-Qaida.

By November, he planned to travel to Afghanistan to work with the Taliban and wage war against "officials of governments that he believes are anti-Muslim, including the U.S. Government," according to federal prosecutors.

Investigators said Bickford told a family member he hoped to be a suicide bomber.

Ultimately, federal prosecutors allege, Bickford decided to attack targets in the United States and settled on Times Square on New Year's Eve.

In a news release Wednesday, the Manhattan district attorney’s office said Bickford “intended to carry out jihad and specifically targeted a uniformed police officer because he was a man in uniform with a weapon.”