An Uzbek immigrant has been charged by US prosecutors with causing the deaths of at least eight people in New York by mowing them down in a truck.
Sayfullo Saipov, 29, is also accused of providing material support and resources to Islamic State (IS) group.
He was shot and injured by police at the scene of the attack, and received treatment in hospital.
Prosecutors say Saipov spoke freely to them, waiving his right to avoid self-incrimination while in custody.
US President Donald Trump tweeted that he should receive the death penalty, even though it has been abolished in New York State.
Tuesday afternoon's attack saw a truck driven down a cycle lane in Lower Manhattan, hitting cyclists and pedestrians.
Six people died at the scene and two more in hospital. Twelve people were injured, nine of whom remain in hospital.
Federal court papers allege:
- Mr Saipov said the attack was planned two months ago
- He said he had intentionally chosen Halloween so that the streets would be crowded
- He wanted to display IS flags on the truck, but decided not to draw attention to himself
- Authorities recovered 90 graphic and violent IS propaganda videos from his phones
- He said he was inspired by them - in particular, one in which IS leader Abu Bakr al-Baghdadi asks what Muslims are doing to avenge deaths in Iraq
Earlier, New York Police's Deputy Commissioner John Miller told reporters:
"He appears to have followed almost exactly to a 'T' the instructions that Isis has put out in its social media channels before, with instructions to their followers on how to carry out such an attack."
A second Uzbek man wanted for questioning in connection with the attacks has been found, investigators say.
The FBI had requested information on Mukhammadzoir Kadirov, 32.
"We are no longer looking for the person the information went out about," William Sweeney, assistant director of the FBI's New York field office, told reporters.
"We have found him and I'll leave it at that."
Who is the suspect?
Sayfullo Saipov had reportedly lived in Tampa, Florida, before moving to Paterson, New Jersey.
He arrived in America from Uzbekistan in 2010 and is a legal resident of the country. Uber confirmed he had been working as a driver for them.
CBS News quotes an intelligence source as saying he was known to US authorities after his name was associated with the subjects of FBI counter-terrorism investigations in 2015.
The source says he had some contact with individuals who were considered radicalised extremists, at least one of whom was Uzbek. It is unclear whether those being investigated were in the US or overseas.
It is unclear if Mr Saipov, who was not the main focus of the investigation, was interviewed at that time by the FBI.
Uzbekistan's President Shavkat Mirziyoyev told President Trump his country was ready to "use all forces and resources" to help investigate the attack. Uzbek officials have not yet confirmed the identity or nationality of the attacker.
Reaction in New York
New York has increased the police presence at key transport hubs, and there will be additional uniformed and plain-clothes police on duty at Sunday's New York Marathon.
President Trump said he was taking steps to end the diversity lottery programme - the immigration system under which the suspect entered the country.
He also attacked the US justice system, and said he would consider sending the suspect to the US military prison at Guantanamo Bay, Cuba.
"We also have to come up with punishment that's far quicker and far greater than the punishment these animals are getting right now," he said.
The administration says it has not ruled out adding Uzbekistan to a list of countries in the president's proposed travel ban.
The mayor of New York City and the governor of New York state have both praised the resilience of New Yorkers - and urged people not to "politicise" a tragedy that took eight lives.
Governor Andrew Cuomo said: "He is a depraved coward, is what he is, and he was associated with Isis, and he was radicalised domestically."
Mr Cuomo and Mayor Bill de Blasio also suggested New York's strict gun control laws had ensured that high-powered weapons could not get into the hands of terrorists.
Who were the victims?
The deaths of five Argentines were confirmed by the country's foreign ministry.
They were part of a group of nine friends in New York to celebrate the 30th anniversary of their graduation from a polytechnic college in the central city of Rosario, Argentine media said.
Rosario has declared three days of mourning.
One of the men who died, steel firm owner Ariel Erlij, helped pay for the friends' trip, La Nación newspaper reported.
The men - all aged 48 or 49 - were named as Hernán Diego Mendoza, Diego Enrique Angelini, Alejandro Damián Pagnucco, Ariel Erlij and Hernán Ferrucci.
Belgian officials said Anne-Laure Decadt, a 31-year-old from Staden in Flanders, was also killed. Three Belgians were wounded.
Two other victims, both Americans, have not yet been named.
- BBC