A Maine man pleaded guilty on Thursday to attempted murder charges, admitting he tried to kill three New York Police Department officers when he attacked them with a machete near Times Square on New Year’s Eve a year ago.

Trevor Bickford, 20, of Wells, Maine, entered the plea in Manhattan federal court to three attempted murder charges and three charges of assaulting U.S. employees or officers. Together, the charges carry a potential penalty of up to 120 years in prison.

Sentencing is set for April 11.

NYE SLASHING SUSPECT TREVOR BICKFORD CHARGED WITH ATTEMPTED MURDER OF POLICE OFFICERS

"On Dec. 31, 2022, I attempted to kill three NYPD officers with a knife while they were working in Manhattan," Bickford said after he was asked to describe his crimes. "I know what I did was wrong and I'm sorry."

Authorities have said the officers were injured when they were attacked by Bickford on the edge of the high-security zone where revelers were screened before entering the blocks around Times Square. The attack occurred about two hours before the new year began.

Bickford shouted "Allahu akbar" — the Arabic phrase for God is great — before striking the officers in the head with the machete and trying to grab an officer’s gun, authorities said. One officer suffered a fractured skull.

New Years Eve Times Square

Pedestrians walk in a nearly empty Times Square ahead of the New Year's Eve celebration Thursday, Dec. 31, 2020, in New York. (AP Photo/Frank Franklin II, File)

All three officers were injured in the attack. Bickford was shot in the shoulder by police and taken to a hospital. Authorities say he had studied radical Islamic ideology and decided to wage jihad against U.S. officials.

During the plea proceeding, Judge P. Kevin Castel questioned Bickford, who confirmed that it was true that he was pleading guilty without any kind of agreement with prosecutors.

At the outset of the hearing, Bickford said he was taking three medications for treatment of schizoaffective disorder.

Assistant U.S. Attorney Sarah Kushner told the judge that evidence in the case included the foot-long machete as well as post-arrest statements in which Bickford left "no doubt" that he attacked the officers because they were military-age men.

SUSPECTED HOMEGROWN TERRORIST TREVOR BICKFORD TO APPEAR IN COURT VIRTUALLY ON NYE SLASHING CHARGES

The officers, she said, were part of a joint task force of city and federal officers assigned to protect the city on New Year's Eve.

She said Bickford had intended to kill "as many as possible" of the men in uniform that he came across.

Kushner said he had intended to die a martyr in the attack and believed it was unsuccessful because nobody died.

The prosecutor said Bickford had originally intended to go overseas and fight alongside terrorists there but eventually decided to carry out an attack in the United States instead. She said he told investigators that he had walked around Times Square before the attack, "trying to figure out the right time to kill."

CLICK HERE TO GET THE FOX NEWS APP

After the plea, Bickford was returned to a federal facility, the Metropolitan Detention Center in Brooklyn. He still faces state charges in connection with the attack.