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 vehicle ahead of time to practise turning it, authorities say.

As they brought terrorism charges against Uzbek immigrant Sayfullo Saipov, federal officials said 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 Saipov "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, 29, 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 attack on Tuesday, 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 Uber 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 practise turns.

He chose a route in lower Manhattan 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.

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 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".

But the President later tweeted: “There is also something appropriate about keeping him in the home of the horrible crime he committed."

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 yesterday Saipov appeared to be the only suspect, but cautioned the investigation was relatively fresh.

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.