The Maine teen charged in the New Year's Eve knife attack near Times Square on New York City police officers is due in court as soon as Tuesday to face attempted murder and attempted assault charges.

Trevor Bickford, 19, of Wells, Maine, carried out what a senior police official told ABC News was a terror attack likely motivated by Islamic extremism.

"He knew what he was doing. He knew why he was doing it and he thought he would die in the attack," Thomas Galati, NYPD Chief of Intelligence and Counterterrorism, told ABC News. "He did yell out 'Allahu Akbar.'"

Galati said the FBI interviewed Bickford last month in Maine after his mother reported her concern that her son was becoming radicalized. The FBI determined Bickford wanted to fight in Afghanistan and placed him on a federal watch list to prevent him from travelling overseas.

Instead, Bickford acquired a large sum of cash, packed a Gurkha knife and boarded a train to New York on Dec. 29. He arrived with what Galati described as intent to carry out an attack on "police officers or anybody in uniform," seeming to advance jihadist propaganda that has called for such attacks using low-tech tactics like stabbings.

A diary found at the scene indicated Bickford thought he would die a martyr, law enforcement sources told ABC News. He ended up shot in the shoulder by an officer on the force just eight months.

"So the event happens outside the secure zone, not inside Times Square," Galati said. "Means that our plan works."

But counterterrorism experts said the attack is yet another example of law enforcement, more than 20 years after the Sept. 11 terrorist attacks, being unable to deal with threats they are aware of prior to an attack. Other examples include the Nov. 19 Colorado Springs nightclub shooting, the 2018 Parkland, Florida, high school massacre and the Jan. 6, 2021, insurrection at the U.S. Capitol building.

Though the circumstances and law enforcement agencies were different, the problem and results are the same, said John Cohen, a former U.S. Department of Homeland Security acting undersecretary for intelligence, and a former police officer and detective.

“It has become increasingly clear that the protocols used by federal and local authorities to assess the risk posed by individuals who exhibit threat-related behaviors is out of date and inconsistent with the current threat facing the nation,” said Cohen, an ABC News contributor.

“Yet again we have experienced a mass casualty attack by an individual who was known to law enforcement, who had exhibited the warning signs but was not subject to a threat management strategy. Unfortunately this has become an all too common occurrence and too many communities have suffered as a result," Cohen said.

Cohen said traditional approaches to disrupting international terror plots do not seem to work when dealing with "ideologically motivated, domestic offenders."

"How many mass casualty attacks need to occur before we change our approach to assessing and managing risk?" Cohen said.