The suspect in the deadly New York truck attack was inspired by Islamic State online videos and plotted his attack for two months - even renting a truck ahead of time to practice turning it, authorities say.
Federal authorities said, as they brought terrorism charges against Uzbek immigrant Sayfullo Saipov, that he chose Halloween for the attack because he thought there would be more people on the streets.
US president Donald Trump said on Twitter that he "should get (the) death penalty".
After his trail of terror was halted by a police bullet, he asked to display the Islamic State flag in his hospital room, saying "he felt good about what he had done," authorities said.
Brought to court in a wheelchair, Saipov was held without bail on charges that could bring the death penalty.
Separately, the FBI was questioning people who might have information about his actions before the attack, including a second Uzbek man.
The charges against Saipov, 29, came just a day after the attack near the World Trade Centre killed eight people.
Investigators in multiple states raced to retrace Saipov's steps and understand his motivations, which they said were illuminated by a note he left by the truck: "Islamic Supplication. It will endure."
The phrase "it will endure" commonly refers to the Islamic State group, and Saipov had a mobile phone loaded with the group's propaganda, an FBI agent said in the criminal complaint.
Handcuffed and with his legs shackled, Saipov nodded his head as he was read his rights in a brief court proceeding that he followed through a Russian interpreter.
Outside court, his appointed lawyer, David Patton, said he hoped "everyone lets the judicial process play out".
"I promise you that how we treat Mr Saipov in this judicial process will say a lot more about us than it will say about him," he said.
The FBI released a poster saying it was looking for one of Saipov's associates, Mukhammadzoir Kadirov, only to announce less than 90 minutes later that it had found him.
A law enforcement official said Mr Kadirov was a friend of Saipov's and may not have any role in the case. Saipov did not have many friends, the official said.
A married father-of-three and former commercial truck and ride-hailing driver, Saipov began planning an attack a year ago and settled on a truck assault a couple of months ago, according to the criminal complaint.
During the last few weeks, Saipov allegedly searched the internet for information on Halloween in New York City and rented a truck to practice turns.
He chose a route along a lower Manhattan highway and initially hoped to continue to hit more pedestrians on the Brooklyn Bridge, the complaint said.
Ultimately, Saipov sped down a bike path on a riverfront esplanade in a rented truck for nearly a mile on Tuesday, running down cyclists and pedestrians, before crashing into a school bus, authorities said.
He was shot after he jumped out of the vehicle brandishing two air guns and yelling "God is great!" in Arabic, they said. Knives were found in a bag he was carrying and a stun gun inside the truck.
In the past few years, the Islamic State group has exhorted followers 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.
The fact that a note was left at the scene was significant, because it showed he was following their instructions to the letter, NYPD Intelligence and Counterterrorism head John Miller said Thursday on CBS This Morning.
"He was following the Isis instructions, which says: If you're going to do this, you need to claim credit for Isis or we won't know you're one of us. And to yell it out, post it online or their magazine even suggested leaving leaflets - and this seems to touch on that last piece," he said.
Saipov's court appearance came hours after Mr Trump said he would consider sending him to the Guantanamo Bay detention centre in Cuba - an idea the White House reinforced by saying it considered Saipov to be an "enemy combatant".
Detainees at Guantanamo accused of supporting militants have faced military tribunals, rather than trials in the US legal system.
By afternoon, though, Saipov was in federal court facing charges that include providing material support to a terrorist group.
Mr Trump's administration could, at least in theory, still send the suspect to the US base in Cuba later, though such a step would be unprecedented.
As well as calling for him to get the death penalty, Mr Trump also suggested eliminating the 1990s visa lottery programme that Saipov used to come to the US in 2010.
Mr Miller said Saipov had never been the subject of a criminal investigation by the FBI or New York police, but appears to have links to people who have been investigated.
He said on Thursday Saipov appeared to be the only suspect, but cautioned the investigation was relatively fresh.
In a report by Radio Free Europe on Thursday, Saipov's family, who live in Uchtepa, on the outskirts of Tashkent, were described as very secular and ordinary, and living a comfortable life.
Citing neighbours of the family, the report says Saipov's parents run a small clothing stall in a local market, and own a car and their own house.
The attack killed five people from Argentina, one from Belgium and two Americans, authorities said. Twelve people were injured.
City leaders vowed New York would not be intimidated and said Sunday's New York City Marathon would go on as scheduled, with increased security.
Authorities have not seen evidence that leads them to believe anyone else was involved in a deadly truck attack on a New York cycle path, a New York Police Department official says.
Deputy Commissioner John Miller said on CBS This Morning that Sayfullo Saipov is the only suspect but that could change.
Mr Miller said Saipov was "following Isis instructions" to "yell it out" and spread the terrorist agenda. He said the group suggests leaving leaflets at the scene of terrorist acts.
The 29-year-old Uzbek immigrant has been charged with terrorism and other crimes.
Eight people were killed in the attack on Tuesday near the World Trade Centre.
Saipov's lawyer, David Patton, said he hopes "everyone lets the judicial process play out".
The suspect has been charged with providing material support to a terrorist group and violence and destruction of motor vehicles.
Even as he lay wounded in hospital from police gunfire, Saipov asked to display the Islamic State group's flag in his room and said "he felt good about what he had done," prosecutors said in court papers.
He appeared in the New York federal courthouse in a wheelchair, handcuffed and with his feet shackled. He 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.
Mr Patton said outside court: "I promise you that how we treat Saipov in this judicial process will say a lot more about us than it will say about him."
Meanwhile, president Donald Trump tweeted that Saipov should get the death penalty.
Separately, the FBI was questioning a second person from Uzbekistan, 32-year-old Mukhammadzoir Kadirov.
A law enforcement official said Mr Kadirov was a friend of Saipov's and may not have any role in the case.
Prosecutors said Saipov had 90 videos and 3,800 photos on one of his two mobile phones, many of them Isis-related pieces of propaganda, including images of prisoners being beheaded, shot or run over by a tank.
Saipov left behind knives and a note, in Arabic and English, that included Islamic religious references and said "Islamic Supplication. It will endure," FBI agent Amber Tyree said in court papers.
"It will endure" commonly refers to Isis, Ms Tyree said.
Questioned in his hospital bed, Saipov said he had been inspired by Isis videos and began plotting an attack about a year ago, deciding to use a truck about two months ago, Ms Tyree said.
During the last few weeks, Saipov had searched the internet for information on Halloween in New York City and for truck rentals, the agent said.
Saipov rented a truck on October 22 to practice making turns and he initially hoped to get from the bike path across lower Manhattan to hit more pedestrians on the Brooklyn Bridge, Ms Tyree said.
He even considered displaying Isis flags on the truck during the attack but decided it would draw too much attention, authorities said.