A would-be suicide attacker who detonated a homemade pipe bomb on the New York City subway has been found guilty of terror offences.

Akayed Ullah injured himself and three other people when he detonated an improvised device strapped to his chest in an underground walkway between stations near Times Square in December 2017.

After the verdict was handed down in Manhattan federal court on Tuesday, Ullah told the judge he had carried out the attack in retribution for the actions of the US president.

Akayed Ullah detonated a pipe bomb strapped to his chest in a subway underpass (AP)

“I was angry with Donald Trump because he says he will bomb the Middle East and then he will protect his nation,” he said.

Judge Richard Sullivan replied: “Right now is not the time for a statement.”

The trial saw Ullah claim he had only intended to kill himself during the attack, which caused no fatalities and left a handful of commuters with minor injuries.

However, prosecutors said he wanted to maim or kill commuters as part of a “lone wolf” terrorist attack on behalf of Isis.

They disputed the defence claim, saying Bangladeshi-born Ullah would not have worn a bomb had he wanted to kill only himself.

They also cited social media postings by the defendant, as well as claims he made to investigators after his arrest that he “did it for the Islamic State”.

At trial, Ullah was confronted with his post-arrest statements and his social media comments, including Facebook taunts directed at Mr Trump before the attack.

Authorities said Ullah’s radicalisation began in 2014, when he started viewing materials online, including a video instructing Isis supporters to carry out attacks in their homelands.

In closing arguments Monday, assistant US attorney George Turner said Ullah told investigators he wanted to avenge US aggression towards Isis and chose a busy weekday morning to attack, hoping to cause “maximum damage”.

Support free-thinking journalism and attend Independent events

The prosecutor said the 28-year-old, of Brooklyn, followed the propaganda group online and wanted to follow its instructions to carry out a “lone wolf” terror attack on Americans.

“His goal was to injure and kill innocent civilians, to terrorise,” Mr Turner added.

Ullah’s attorney Amy Gallicchio, had argued her client had detonated the device strapped to himself in an isolated corridor, as opposed to a packed subway carriage, in a bid to take his own life.

“It was a disturbing act by a disturbed man,” she said. “This is not a lone-wolf attack”.