Ahmad Khan Rahimi, center, appears in court in New Jersey in December 2016. (Mel Evans/AP)

The man convicted of setting off explosives in Manhattan in 2016, injuring dozens and sparking a sprawling manhunt that ended with a violent shootout with police, was sentenced Tuesday to spend the rest of his life in prison.

The bomber, Ahmad Khan Rahimi, was convicted in the fall on all eight counts he faced for planting explosives in the Chelsea neighborhood. One of the bombs detonated on Sept. 17, 2016, injuring 31 people, while another was found on a sidewalk and did not explode. He was also accused of planting or setting off other explosives in New Jersey in the hours and days before and after the Chelsea bombing.

“Inspired by ISIS and al-Qaeda, Ahmad Khan Rahimi planted and detonated bombs on the streets of Chelsea, and in New Jersey, intending to kill and maim as many innocent people as possible,” Geoffrey S. Berman, the acting U.S. attorney for the Southern District of New York, said in a statement. “Less than a year-and-a-half after his attacks, Rahimi has now been tried, convicted, and sentenced to life in prison. Rahimi’s conviction and sentencing are victories for New York City and our nation in the fight against terror.”

During his two-week trial in October, Rahimi, whose name is sometimes spelled in documents as Rahami, did not testify in his defense, and during closing arguments his attorneys disputed only the charges that had convictions that carried life sentences. One of his attorneys did not immediately respond to a request for comment about the sentencing on Tuesday.

According to prosecutors, Rahimi “failed to show remorse for his crimes” and instead actively tried to radicalize other inmates he met behind bars. That began at least as far back as October — the same month he was tried and convicted — and involved “distributing extremist materials” to other inmates, prosecutors wrote in a sentencing memo last month. Those materials included bomb-making instructions along with speeches and lectures by the late Anwar al-Awlaki, the U.S.-born imam who inspired numerous attacks, and the late al-Qaeda leader Osama bin Laden.

Rahimi, 30, was born in Afghanistan before his family moved to the United States in 1995. He became a naturalized U.S. citizen in 2011, a little more than five years before the bombing.  Federal prosecutors said he began researching terrorist ideologies the following year, looking at jihadist material online and eventually searching for material relating to building bombs.

Authorities said Rahimi was responsible for more than just the Chelsea attack, which targeted New Yorkers on a Saturday night just days after the 15th anniversary of the 9/11 terrorist attacks.

Hours before the Chelsea bombing, officials said, Rahimi also set off explosives along the route for a 5K charity race benefiting Marines; the race’s start was delayed, so there were no crowds around when the bomb detonated. The following day, as law enforcement officials hunted for Rahimi, they found a half-dozen explosive devices inside a backpack at a New Jersey Transit station.

Police officers in New Jersey found Rahimi the next morning sleeping in the doorway of a bar. Officials said he began firing at the officers who approached him, ending in a shootout that badly wounded him.

A journal found on Rahimi contained notes about martyrdom and explosives, along with positive references to the Islamic State and al-Qaeda, among others, according to federal officials. Images of the journal were later made public, showing what appeared to be a bullet hole through blood-soaked pages.

Image of the journal. (House Homeland Security Committee)

The explosions in New Jersey and New York in September 2016 were alarming both for the number of devices Rahimi planted as well as for how much worse the attacks could have been. Prosecutors noted that had the charity race started on time, runners would have been passing by when the explosive went off along the route. Hours later in Chelsea, the bomb that went off there sent metal shrapnel and glass flying through the air, along with a heavy dumpster that had been near where Rahimi left the device.

After the explosion, New York Gov. Andrew Cuomo (D) said: “When you see the amount of damage, we really were very lucky there were no fatalities.”

Further reading:

Young men left America to join ISIS. They ended up cooking and cleaning for the caliphate.

New York truck attack suspect charged with terrorism offense as Trump calls for a death sentence

Trump administration divided over how to handle two ISIS militants