A Bangladeshi immigrant arrested over a New York subway bombing blamed President Donald Trump for the botched suicide mission that he said he carried out for the Islamic State group, authorities said as they brought federal charges against him.

Akayed Ullah posted a statement on his Facebook account on his way to the Monday morning attack stating: “Trump you failed to protect your nation”, the criminal complaint said.

He also told law enforcement officers at the hospital where he was taken with burn injuries to the body and hands: “I did it for the Islamic State”, according to the complaint.

His rush-hour attack fizzled in a long walkway used by commuters moving between trains in the city’s busiest subway station at Times Square.

Three pedestrians complained of harmed hearing and headaches after the bomb went off.

Ullah, 27, was expected to appear before a magistrate judge, though it was not immediately clear if he was well enough to go to court.

During a search of his Brooklyn apartment, investigators recovered a passport with the words “O America, die in rage” scrawled in it, the complaint said.

He hoped to “terrorise as many people as possible” with a bomb filled with metal screws that he believed would cause maximum damage, the complaint said.

The complaint charged Ullah with providing material support to a terrorist group, use of a weapon of mass destruction and three bomb-related counts.

Police patrol the passageway, which is back in use (Seth Wenig/AP)Police patrol the passageway, which is back in use (Seth Wenig/AP)

According to the complaint, Ullah began researching how to build bomb after he had “viewed pro-Isis materials online, including a video instructing, in substance, that if supporters of Isis were unable to travel overseas to join Isis, they should carry out attacks in their homelands”.

Overseas, Bangladesh counter-terrorism officers were questioning Ullah’s wife and other relatives, officials there said on Tuesday.

Relatives and police said Ullah last visited Bangladesh in September to see his wife and newborn son before leaving them behind to return the United States.

Hours after Monday’s explosion, Mr Trump cited the background of the bomber in renewing his call for closer scrutiny of foreigners who come to the country and less immigration based on family ties.

Ullah, who told investigators he wanted to retaliate for American action against Islamic State extremists, came to the US from Bangladesh in 2011 on a visa available to certain relatives of US citizens.

“Today’s terror suspect entered our country through extended-family chain migration, which is incompatible with national security,” Mr Trump said in a statement that called for various changes to the immigration system.

Earlier, White House spokeswoman Sarah Huckabee Sanders said Mr Trump’s proposed policies “could have prevented this”.

Bangladesh counterterrorism officers are questioning the wife and other relatives of Ullah (A.M. Ahad/AP)Bangladesh counterterrorism officers are questioning the wife and other relatives of Ullah (A.M. Ahad/AP)

On his last visit to Bangladesh, the suspect mostly remained inside a small apartment in Dhaka’s Hazribagh area, said his uncle, Abdul Ahad.

His nephew arrived in Bangladesh on September 8 and returned to New York on October 22, he said.

“He went out of his residence to offer prayers at a nearby mosque,” Mr Ahad said.

In a scenario New York had dreaded for years, Ullah strapped on a crude pipe bomb with Velcro and cable ties, slipped unnoticed into the nation’s busiest subway system and set off the device, authorities said.

The device did not work as intended; authorities said Ullah was the only person seriously wounded.

But the attack sent frightened commuters fleeing through a smoky passageway.

Ullah’s low-tech bomb used explosive powder, a nine-volt battery, a Christmas light and matches, officials said.

Investigators said the suspect was seen on surveillance footage igniting the bomb.

In the end, it was not powerful enough to turn the pipe into deadly shrapnel, the officials said.