Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A New Jersey man already sentenced to life in prison for bombs placed in that state and New York City in 2016 was given another life term for shooting Linden police officers during his arrest, prosecutors said.

Ahmad K. Rahami, also known as Ahmad K. Rahimi, was sentenced Friday in a New Jersey state court following his conviction on five counts of attempted murder and aggravated assault and weapons offenses in October, the Office of the Union County Prosecutor said.

No one was killed in the bombings, which happened during a September weekend, but 30 people were injured when a pressure-cooker bomb detonated in a New York City neighborhood.

The blast was so powerful that it sent a Dumpster flying more than 150 feet down the sidewalk and shattered windows more than a block away. Another bomb several blocks away did not detonate. The two bombs were pressure cookers packed with ball bearings and steel nuts.

Rahami was allegedly inspired by the terrorist groups ISIS and al Qaeda.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The charges for which Rahami was sentenced Friday related to his arrest in Linden days after the bombings.

Rahami shot an officer who approached him in a vestibule of a tavern, where Rahimi had been sleeping, the morning of Sept. 19, 2016. The officer was hit in the chest but the round hit his bullet-resistant vest.

Rahami shot at other officers as he fled, firing 20 rounds at police, the prosecutor’s office said. A second officer was hit in the head by a bullet fired by Rahami that went through the officer’s windshield.

"This defendant tried to murder members of our law enforcement community, and the sentence imposed by the Court today holds him accountable for his violent acts,” Union County Prosecutor Lyndsay V. Ruotolo said in a statement.

Rahami was convicted in October 2017 on eight federal counts stemming from two New York City bombs, and he was sentenced in the following February to life in prison.

He was sentenced to two life sentences plus 30 years in that case.

In addition to the two bombs in New York City, a pipe bomb exploded along the route of a planned Marines 5K charity run in the New Jersey shore town of Seaside Park. The race had been delayed, and no one was hurt.

Amid a manhunt for Rahami, a backpack containing additional explosives was found near a New Jersey transit station in Elizabeth, New Jersey.

Rahami is a naturalized U.S. citizen who was born in Afghanistan. He was a child when his family sought asylum in America.