Updated

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 came after a two-week trial of Ahmad Khan Rahimi, 29, an Afghanistan-born man living in Elizabeth just outside New York. 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 terror group and Al Qaeda to carry out the late summer attacks in New York and New Jersey.

"Rahimi's crimes of hate have been met with swift and resolute justice," Acting U.S. Attorney Joon Kim said in a statement. "Just over a year after his attacks, and following a fair and open trial, Rahimi now stands convicted of his crimes of terror by a unanimous jury of New Yorkers."

0337d737-Ahmad Rahimi

Ahmad Khan Rahimi, an Afghan-born U.S. citizen convicted of planting bombs in New York and New Jersey, appears in Union County Superior Court for a hearing in Elizabeth, New Jersey. (REUTERS)

In his closing argument, Assistant U.S. Attorney Emil Bove described an unusually large amount of evidence that pointed to Rahimi, including his fingerprints and DNA that were found on bombs in the Sept. 17 attack.

Dozens of videos tracked his movements as he dragged the bombs in suitcases through Manhattan streets, and they also captured the explosion at 23rd Street in the Chelsea neighborhood that injured 30 people. The second bomb planted on city streets didn't detonate.

rahimi122016

Ahmad Khan Rahimi, the man convicted of setting off bombs in New Jersey and New York in September 2016. (AP Photo)

As a bomb squad investigator testified, prosecutors showed jurors a mangled, waist-high trash bin that was sent flying 120 feet across a busy street by the bomb. Federal prosecutors called it a miracle that nobody was killed by the explosive, which scattered ball bearings meant to serve as shrapnel.

If that wasn't enough, Bove said, jurors could look at a small notebook that was on Rahimi when he was arrested two days after the attack following a shootout with police in New Jersey. The prosecutor said Rahimi's written words provided a confession as he took responsibility for the bombings in a "claim of credit" for attacks that left him feeling proud.

The 29-year-old still faces charges in New Jersey related to the shootout. He has pleaded not guilty to attempted murder of police officers.

Assistant public defender Sabrina Shroff did not deny evidence linking Rahimi to the 23rd Street bomb, but asked jurors to question whether Rahimi really intended for the 27th Street bomb to go off. She urged the jury to acquit Rahimi of three charges that could result in a mandatory life prison sentence.

And she expressed compassion for those injured by the blast, some of whom testified during the trial.

"This is a difficult case for all of us because we are all New Yorkers," Shroff said.

Prosecutors said Rahimi left his home before sunrise to plant a pipe bomb along the route of a Marine Corps charity race in Seaside Heights, New Jersey. No one was injured in that explosion because the race had been delayed.

Hours later, Rahimi went into Manhattan, where he was seen walking from Penn Station to the street locations where two bombs were placed.

Assistant U.S. Attorney Andrew DeFilippis said in closing arguments that Rahimi had carried out a "cold and calculating" attack with a variety of explosive devices that included a backpack filled with seven bombs, some small enough to use like hand grenades.

The prosecutor said Rahimi could be convicted even if some bombs didn't explode because the government only needed to prove that he took "substantial steps" to set off explosives.

Alluding to the numerous street videos jurors watched of Rahimi walking through Manhattan, DeFillipis reminded jurors that they had seen him take "step after step after step," including after the 23rd Street bomb exploded.

He said Rahimi was seen "walking away so he wouldn't get hurt while others bled."

The Associated Press contributed to this report.