A New Jersey man was convicted Monday of planting two pressure-cooker bombs on New York City streets, including one that injured 30 people with a rain of shrapnel when it detonated in a bustling neighborhood on a weekend night last summer.

The verdict in Manhattan came after a two-week trial of 29-year-old Ahmad Khan Rahimi, an Afghanistan-born man living in Elizabeth. The charges, including using a weapon of mass destruction and bombing a public place, carry a maximum punishment of life in prison.

Prosecutors said Rahimi considered himself “a soldier in a holy war against Americans” and was inspired by the Islamic State group and al-Qaida to carry out the late summer attacks in New York and New Jersey.

He was found guilty of all the charges against him. The defense said it will appeal.

Rahimi pleaded not guilty after his arrest two days after the September 2016 attacks following a shootout with police in New Jersey that left him hospitalized for weeks. He has been held without bail since his arrest.

Jurors were shown dozens of videos that captured Rahimi walking the streets of Manhattan to where each of the bombs was placed. Prosecutors said he paused three times along the way because the bombs contained timers and he needed to meet the schedule he had set.