Federal prosecutors brought terrorism charges on Wednesday against the Uzbek immigrant accused in the truck rampage that left eight people dead, saying he was spurred to attack by online jihadist propaganda.

The charges against 29-year-old Sayfullo Saipov, who appeared in court in a wheelchair, handcuffed and with his feet shackled, could bring the death penalty.

During his court appearance, Saipov was ordered detained and didn't enter a plea. His lawyers didn't seek bail.

Even as he lay wounded in the hospital from police gunfire, Saipov asked to display the Islamic State of Iraq and the Levant flag in his room and said "he felt good about what he had done," prosecutors said in court papers.

"NYC terrorist was happy as he asked to hang ISIS flag in his hospital room. He killed 8 people, badly injured 12. SHOULD GET DEATH PENALTY!" President Donald Trump tweeted.

Meanwhile, the FBI said it wanted to question a second Uzbek - 32-year-old Mukhammadzoir Kadirov - and had found him.

A law enforcement official said Kadirov might not have a role in the case, but investigators became suspicious when they couldn't find him as he was one of Saipov's few friends.