A former hire car driver who allegedly set off a pipe bomb in one of New York City's busiest transport corridors allegedly posted on his Facebook minutes before the attack: "Trump you failed to protect your nation".
Akayed Ullah, 27, was charged on Tuesday, local time, about 24 hours after the explosion that caused a peak hour frenzy in Midtown Manhattan.
He is accused of putting together a low-tech explosive device in his Brooklyn apartment using household items, Christmas tree lights, screws and a piece of pipe that he found at a job site in Midtown where he had worked as an electrician recently.
Ullah was charged by New York officials with making a terroristic threat, supporting an act of terrorism and criminal possession of a weapon. Federal charges were laid soon after including providing material support to a terrorist organisation, using a weapon of mass destruction and bombing a public place.
Police say Ullah entered an underground walkway beneath 42nd Street and 8th Avenue that connected two subway stations - Port Authority and Times Square - at about 7.20am on Monday, local time.
He allegedly detonated the bomb that was strapped to his chest using Velcro strips and cable ties. But only the chemical component exploded; the pipe didn't shatter so no shrapnel was released.
Ullah was the only person injured and is recovering in hospital with serious burns and cuts to his hands and abdomen.
An unsealed criminal complaint said that Ullah spoke with law enforcement officers shortly after his arrest, admitting that he carried out the attack as revenge for US policies in the Middle East.
"Ullah stated, among other things, 'I did it for the Islamic State'," the complaint said.
He said he had started reading Islamic State propaganda online in about 2014 and had researched how to make a bomb for about a year, according to the complaint.
He started collecting materials two weeks ago and built the pipe bomb in his Brooklyn apartment last week.
As he was on his way to the Port Authority bus terminal location, he posted a statement on Facebook saying: "Trump you failed to protect your nation".
"He also posted a statement that he believed would be understood by members and supporters of ISIS to convey that Ullah carried out the attack in the name of ISIS," the complaint said.
Authorities have described the incident as a failed suicide bombing. It is the first attempted suicide bombing in the city.
Ullah, who moved to the US in 2011 on a family reunification visa, lived with his parents and brother in a sixth-floor apartment in a Bangladeshi enclave in Brooklyn, where locals described him as quiet, unremarkable and sometimes unfriendly.
Reuters reported that police in Bangladesh were questioning his wife in Dhaka and that the couple have a six-month old son.
A cousin in Bangladesh, Emdad Ullah, told Reuters that Ullah and his family originally lived the Chittagong region in southern Bangladesh but moved to the capital, Dhaka, years ago.
Ullah had married a Bangladeshi woman about two years ago, and she lived in Dhaka, the cousin said, adding that Ullah had a normal education in Bangladesh before moving to the United States.
He had no criminal record in his home country, which he last visited in September, or the US.???
President Donald Trump said the attack emphasised the need for US immigration reforms. He has vowed to end 'chain migration' which allows family members like nieces and nephews to obtain green cards to live in the US. Ullah reportedly obtained a visa through an uncle in the US.
"America must fix its lax immigration system, which allows far too many dangerous, inadequately vetted people to access our country," he said in a statement.