New York: An Uzbek immigrant suspected of killing eight people in New York City by ploughing a truck into cyclists and pedestrians on a bike path has asked to display Islamic State's flag in his hospital room as he recovers from a gunshot wound.

The suspect, Sayfullo Saipov, 29, who was hospitalised after a police officer shot and arrested him, ending Tuesday's rampage, confessed to authorities while in custody that he began planning the attack a year ago, according to the criminal complaint filed against him.

He was charged in federal court on Wednesday with acting on behalf of the militant group Islamic State.

The 10-page complaint said Saipov waived his rights to remain silent and avoid self-incrimination in agreeing to speak to investigators without an attorney present from his Bellvue Hospital Center bed in Manhattan.