Updated

A Bangladeshi immigrant accused of setting off a pipe bomb in the New York subway system had his first court appearance on Wednesday via video from the hospital room where he is recovering from burns sustained in the blast.

Akayed Ullah said little during the hearing, which lasted a little over 10 minutes. He could be seen on the video lying on a hospital bed with his head propped up on a pillow and his body covered up to his neck in sheets. Two assistant public defenders, who stood beside his hospital bed, did not request bail.

U.S. Magistrate Judge Katharine H. Parker, sitting in a federal courthouse in Manhattan, communicated with Ullah via video shown on several monitors in the courtroom. She read him his rights as he nodded his head several times, acknowledging that he understood.

Ullah didn't enter a plea but answered a few of the judge's questions, including answering "I can see you" when she asked if he could hear her and "yes I do" when he was asked if he understood his rights.

Ullah, 27, is accused of detonating a pipe bomb that was strapped to his body in a pedestrian tunnel linking two busy subway stations. He was the only person seriously injured.

Prosecutors said that after his capture he told interrogators he was on a mission to punish the U.S. for attacking the Islamic State group.

Officials in Bangladesh said Wednesday that Ullah, who lived in Brooklyn but was married to a woman in Bangladesh, had asked his wife to read the writings and listen to the sermons of Moulana Jasimuddin Rahmani, the imprisoned leader of a banned group called Ansarullah Bangla Team.

The group has been linked to killings and attacks on secular academics and atheist bloggers in Bangladesh. Rahmani is serving time in prison for his involvement in the killings.

The wife was questioned in Bangladesh and told investigators Ullah discussed Rahman's writings with her during his last visit home, said Monirul Islam, a top official of Bangladesh's counterterrorism department.

Investigators found bomb-making materials in Ullah's apartment. They said he carried out the attack after researching how to build a bomb a year ago and planned his mission for several weeks. The bomb was assembled in the past week using fragments of a metal pipe, a battery and a Christmas tree light bulb, along with the metal screws, authorities said.

Ullah had apparently hoped to die, taking as many innocent people as he could with him, prosecutors said. He was charged with providing material support to a terrorist group, use of a weapon of mass destruction and three bomb-related offenses. He could get up to life in prison if convicted.

Relatives and police said Ullah last visited his wife and newborn son in Bangladesh in September, after which he returned to the United States.

Counterterrorism officials questioned the wife and her parents before releasing her Tuesday night, Islam said, adding that investigators were questioning his brother-in-law and planned to question any known close associates.

Ullah's wife, Jannatul Ferdous, told ABC News in a brief interview conducted through the closed door of her home in Dhaka, Bangladesh, that she had never heard him speak negatively of the U.S. She said when she spoke to him by phone the morning of the bombing he gave no indication of what he planned to do.

With a tragedy averted and a growing certainty that he acted alone, attention turned to how best secure New York's vast public transportation system and the daunting task of identifying those eager to do it harm.

The security "requires every single member of the public's help," police Commissioner James O'Neill said. "It requires their vigilance."

There also was political fallout, heightened by news that Ullah had taunted President Donald Trump on Facebook with a post that read, "Trump you failed to protect your nation."

In reaction to the bombing, the Republican president demanded a tightening of immigration rules that allowed Ullah to enter the country in 2011 on a visa available to certain relatives of U.S. citizens. Less than two months ago, an Uzbek immigrant who came to the U.S. through a visa lottery was accused of killing eight people by mowing them down with a truck along a bike path near the World Trade Center.