Police on Tuesday filed terror-related charges against a 27-year-old Bangladeshi driver accused of detonating a homemade pipe bomb strapped to his body in a crowded passage of the New York subway.

Akayed Ullah, 27, of Brooklyn, was charged with criminal possession of a weapon, supporting an act of terrorism and making a terroristic threat, police said.

It was not immediately clear when he would be presented in court. Ullah has been held in custody at a hospital after wounding himself and three other people at the Port Authority bus terminal, close to iconic Times Square, on Monday.

Ullah reportedly told police he was inspired by the Islamic State extremist group, wanted to avenge US air strikes on jihadists in Iraq and Syria, and was motivated by Christmas terror plots in Europe.

But his bomb failed to detonate as planned, leaving him the only one seriously harmed, officials said. The three others suffered minor complaints such as ringing in their ears and headaches.

President Donald Trump seized upon the attempted attack to call for tougher US immigration rules, saying the current policy allows ‘far too many dangerous, inadequately vetted people to access our country.’

Monday's explosion came six weeks after an immigrant from Uzbekistan drove a rented truck down a busy Manhattan bike path, killing eight people and wounding 12 others. He was also allegedly inspired by the IS extremist group.

Ullah's family issued a statement through the Council on American-Islamic Relations saying they were ‘heartbroken’ by the attack and the allegations against their relative.

Related Story