Lying in a hospital bed, accused New York City subway bomber Akayed Ullah was presented Wednesday with federal charges that could put him in prison for life.

It was his first court appearance since he allegedly detonated a pipe bomb in a subway passageway near the Port Authority Bus Terminal in what prosecutors described as a bungled suicide attack carried out in the name of ISIS.

Linked to a Manhattan federal courtroom by video, Ullah was shown with his head propped on a pillow and a white blanket covering his torso where, police say, he strapped a crude explosive device he made following instructions on the Internet.

He spoke only to give short answers to questions from the judge about the charges, which include material support of a terrorist organization and using a weapon of mass destruction. When he started to give a longer response to a question about his finances, his public defender cut him off.

Federal prosecutors asked that he be held without bail, and his attorney did not oppose that, so he will remain in custody at least until his next court date on Jan. 13.

Ullah, 27, was the only person seriously injured in the blast and he has been recovering from wounds and burns at Bellevue Hospital.

The Bangladeshi immigrant came to the United States on a family visa in 2011 and worked as a taxi driver and electrician. He has a wife and a 6-month-old child who live in Dhaka, the capital of his homeland.

According to prosecutors, he began dabbling in ISIS propaganda online about three years ago and became radicalized. About a year ago, he began plotting a suicide attack to avenge U.S. policies in the Middle East, and three weeks ago he started gathering materials for the pipe bomb he built in his Brooklyn apartment and strapped to his body on Monday, according to the criminal complaint.

After the bombing attempt, Ullah allegedly told investigators he was acting in the name of ISIS. They found a post on his Facebook account that taunted President Trump that "you failed to protect your nation." Prosecutors said his passport contained another message: "O America, die in your rage."

Akayed Ullah, 27, after he allegedly set off a pipe bomb in a New York subway station on Monday.

Law enforcement officials in the U.S. and in Bangladesh have said that Ullah was not on their radar for extremist views.

But police in Bangladesh disclosed Wednesday that Ullah had encouraged his wife to read the writings of Jashimuddin Rahmani, the imprisoned leader of the outlawed group Ansarullah Bangla Team, which has been accused of orchestrating the killings of atheist bloggers.

Bangladesh counterterrorism chief Monirul Islam said his investigators had not found any direct links between Ullah and Rahmani, who was allegedly inspired by al Qaeda.

Rahmani has been linked to another U.S. terror defendant, Quazi Nafis, who is serving a 30-year sentence after being caught in a federal sting operation and pleading guilty to a plot to blow up the U.S. Federal Reserve Bank in Manhattan.

Tracy Connor reported from New York and Omar Tasiq reported from Dhaka.