An Uzbek immigrant accused of a deadly truck attack on a New York cycle path has been charged with providing material support to a terrorist group and violence and destruction of motor vehicles.
Suspect Sayfullo Saipov was charged on Wednesday in a criminal complaint following the Tuesday afternoon attack that killed eight people near the World Trade Centre.
He appeared in the New York federal courthouse in a wheelchair, handcuffed and with his feet shackled, and was ordered to be detained.
His lawyers said they were not seeking bail, and Saipov did not enter a plea. A judge set his next court date for November 15.
Federal prosecutors say the man was "consumed by hate and a twisted ideology" when he attacked people on the cycle path on Tuesday.
He is charged with providing material support to the Islamic State terrorist group.
Prosecutors say he was stopped by a "brave" police officer, who shot and wounded him Tuesday. They say he had been planning the attack for months.
The FBI had said earlier on Wednesday that another person was wanted for questioning over the attack that left at least 12 people injured.
The bureau had issued a poster seeking the public's help with information about the man, but at a news conference later, FBI assistant director in charge Bill Sweeney said: "We've found him, and we'll leave it at that."
He did not elaborate on why authorities were seeking the man, who was born in Uzbekistan.
The authorities said Saipov watched Islamic State videos on his mobile phone and picked Halloween for the attack because he knew more people would be out on the streets.
Afterwards, as he lay injured in hospital, he asked to display the IS flag in his room and "stated that he felt good about what he had done," prosecutors said in court papers.
Saipov left behind knives and a note, handwritten in Arabic, that included Islamic religious references and said "it will endure" - a phrase that commonly refers to IS, FBI agent Amber Tyree said in court papers.
Questioned in his hospital bed, Saipov said he had been inspired by IS videos and began plotting an attack about a year ago, deciding to use a truck about two months ago, the agent said, and he even rented a truck on October 22 to practise making turns.
John Miller, deputy New York police commissioner for intelligence, said Saipov "appears to have followed, almost exactly to a T, the instructions that ISIS has put out".
In the past few years, the Islamic State has exhorted followers online to use vehicles, knives or other close-at-hand means of killing people in their home countries. England, France and Germany have all seen deadly vehicle attacks since mid-2016.
A November 2016 issue of the group's online magazine detailed features that an attack truck or van should have, suggested renting such a vehicle and recommended targeting crowded streets and outdoor gatherings, according to the SITE Intelligence Group, a militant-monitoring agency.
Carlos Batista, a neighbour of Saipov's in Paterson, New Jersey, said he had seen the suspect and two friends using the same model of rented truck several times in the past three weeks.
It was not clear whether Saipov had been on the radar of the authorities.
Mr Miller said he had never been the subject of a criminal investigation but appears to have links to people who have been investigated.
In Tuesday's attack, Saipov drove his speeding truck for nearly a mile along a cycle path, running down cyclists and pedestrians, then crashed into a school bus.
He was shot in the stomach after he jumped out of the vehicle brandishing two air guns, one in each hand, and yelling "God is great!" in Arabic.