The teenager accused of attacking three police officers with a machete near Times Square on New Year's Eve pleaded not guilty on Wednesday to attempted murder and terrorism charges in New York Supreme Court.

Trevor Bickford, 19, shuffled into court in shackles and a brown jumpsuit, flanked by two plainclothes police officers. He faces a mandatory sentence of life in prison if he is convicted of the top charge against him.

Bickford faces charges in both state and federal court. He appeared in federal court on Monday, where he faces four counts of attempted murder of officers and U.S. government employees, each carrying a sentence of 20 years. He is currently in federal custody.

Prosecutors say Bickford approached three officers at the corner of West 52nd Street and Eighth Avenue at about 10 p.m. on New Year's Eve. Two of the officers suffered head wounds, and were treated at Bellevue Hospital. They have since been released.

Bickford, who was shot in the shoulder during the attack, was also treated at Bellevue, where he made his first appearance from his hospital bed.

Police say Bickford was motivated by religious extremism. They said he traveled from Maine to New York with intent to kill government officials.

A spokesperson for the Legal Aid Society, which is representing Bickford, has asked the public to “refrain from drawing hasty conclusions” in the case.

An earlier version of this story misstated the charges that Bickford faces in state court. He faces attempted murder and terrorism charges.