A Bangladeshi immigrant charged with detonating a homemade pipe bomb in a passageway between subway stations in New York City was found guilty on all charges Tuesday.

Akayed Ullah, 28, was accused of detonating and attempting to detonate a bomb in a subway station near the Port Authority Bus Terminal on December 11, 2017.

He was indicted in January for providing and attempting to prove material support to ISIS, using a weapon of mass destruction, bombing a public transportation system and conducting a terrorist attack, among other federal charges.

During the trial, jurors were shown surveillance video of Ullah leaving his home, getting onto the subway and finally getting burned when his bomb went off. Ullah was seen splayed on the ground as police officers approached with guns drawn.

After the verdict was announced in Manhattan federal court, Ullah said he was upset with President Trump but the defense denied he was a supporter of the Islamic State, as prosecutors alleged.

He faces up to life in prison.

U.S. Attorney Geoffrey S. Berman said in a statement that it was fitting that Ullah's conviction fell on election day

"Ullah’s sinister purpose was to harm and terrorize as many innocent people in his path as possible, by using deadly violence to make a political statement. Ullah’s conviction by a unanimous jury of New Yorkers falls on an Election Day, which fittingly underscores the core principles of American democracy and spirit: Americans engage in the political process through votes, not violence. Today, Ullah stands convicted, he faces a potential life sentence, and his purpose failed. New York City remains a shining symbol of freedom and hope," the statement said.

In a statement, NYPD Commissioner James P. O'Neill said this verdict showed New Yorkers will never be deterred by anyone.

"Today’s jury verdict of guilty on all charges demonstrates clearly that New Yorkers will never be deterred by anyone who seeks to sow fear in our city, or challenge our nation’s way of life. Violence will never have a place in any discussion in a democratic society. Our fight against the evolving face of terrorism is one that no law enforcement agency can afford to lose, and neither can the public we serve. And so, as we make our way forward together, we remain steadfast in our commitment to maintain public safety in every neighborhood," O'Neill said in the statement.

Ullah only seriously injured himself when his homemade bomb exploded in a passageway crowded with morning commuters. The defense said Ullah only intended to kill himself, though prosecutors accused him of a "lone wolf" terror attack on behalf of ISIS.

It was a Monday at 7:20 a.m. when Ullah, who moved to the U.S. in 2010, detonated an improvised bomb only blocks away from one of New York’s largest transit hubs. Only five people suffered minor injuries, despite rush hour crowds traveling through the area.

Surveillance footage showed commuters walking in the passageway when the bomb exploded, then smoke filled the screen and people scattered. In the video, Ullah appeared to fall to the ground. Police later said his arm and torso were badly injured in the blast.

A Port Authority Police Department officer, who was undercover at the time looking for children being trafficked at the bus terminal nearby, apprehended Ullah, with the help of three other officers.

Once he was taken into custody, he admitted to making the pipe bomb at his home in Brooklyn after being inspired by ISIS, telling police: "I did it for the Islamic State."

During the investigation, police found evidence of bomb making and a passport in Ullah’s name with handwritten notations, including "O AMERICA, DIE IN YOUR RAGE" at his home.

The attack came only two months after an immigrant from Uzkbekistan, also allegedly inspired by ISIS, drove a truck into a crowd on a bike path in lower Manhattan.