An Uzbek immigrant suspected of killing eight people in New York City by plowing a truck into cyclists and pedestrians on a bike path was charged in federal court on Wednesday with acting on behalf of the militant group Islamic State. The suspect, Sayfullo Saipov, 29, who was hospitalized 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. 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. In the course of that interview, the complaint said, Saipov told investigators he was inspired by Islamic State videos he had watched on his cellphone, chose Halloween for the attack because he believed more people would be on the streets, and had originally planned to strike the Brooklyn Bridge as well as the bike path. The complaint also said Saipov had requested permission to display Islamic State's flag in his hospital room and said he felt good about what he had done. Meanwhile, the Federal Bureau of Investigation posted an online wanted poster of a second Uzbekistan-born man, named Mukhammadzoir Kadirov, 32, who was described as being sought for questioning in connection with the attack along the Hudson River in lower Manhattan. Saipov was charged with one count of providing material support and resources to a foreign terrorist organization, designated in the complaint as Islamic State, and one count of violence and destruction of motor vehicles. New York City police earlier in the day said that Saipov had carried out the attack according to instructions he found posted online by Islamic State, on whose behalf he claimed to have acted. Police also said Saipov had left behind a note extolling Islamic State, also known as ISIS. "The gist of the note was that the Islamic State would endure forever," New York Deputy Police Commissioner John Miller told a news conference. "He appears to have followed almost exactly the instructions that ISIS has put out on its social media channels to its followers." The attack was the deadliest in New York City since Sept. 11, 2001, when suicide hijackers crashed two jetliners into the World Trade Center, killing more than 2,600 people. Tuesday's attack injured 12 people, some critically, in addition to those killed. Similar assaults using vehicles as weapons took place in Spain in August and in France and Germany last year.