Chelsea bomber Ahmad Khan Rahimi was convicted of attempted murder Tuesday for opening fire on New Jersey police officers in a brazen, broad daylight shootout during his arrest, authorities said.

Rahimi, a homegrown Islamic terrorist who lived in Elizabeth, NJ, was already facing a lifetime in prison on a federal conviction for detonating a series of pressure cooker bombs in a terror plot in Manhattan and New Jersey in 2016.

On Tuesday, a jury in Union County found the 31-year-old guilty of five counts of attempted murder of a cop as well as multiple counts of aggravated assault and weapons charges, authorities said.

The state charges stem from his September 2016 arrest that started when cops stumbled across the wanted bombmaker sleeping in front of a Linden bar after the owner calls police about the suspected bum, cops said.

When cops arrived around 10:30 a.m., Rahimi pulled a 9mm gun and opened fire — hitting one of the Linden officers in the torso and bullet-proof vest, according to authorities.

Cops and Rahimi exchanged gunfire for several blocks until he was shot multiple times outside an auto repair shop and officers arrested him.

Another officer was injured by a bullet fragment that pierced the police car’s windshield and hit him in the head, according to the Union County Prosecutor’s Office.

Acting Union County Prosecutor Lyndsay Ruotolo commended the “valor” of the officers whose response “simply cannot be overstated.”

“They rushed into an extraordinarily dangerous and unpredictable scenario without a moment’s hesitation, and with only the protection of the public and the apprehension of a violent criminal in mind,” she said.

Federal authorities had issued an alert to all local police for the Afghanistan-born man for planting bombs Chelsea and in Seaside Park on Sept. 17, 2016. A backpack full of pipe bombs linked back to Rahimi was also found by two homeless men at a train station in Elizabeth that weekend.

A Manhattan federal jury convicted the bomber last year in the series of blasts that injured dozens.

The trial in New Jersey lasted three weeks on the 30-county indictment and the jury came to its decision in several hours deliberation over two days, the prosecutor’s office said.