Alleged Chelsea bomber Ahmad Rahimi was caught on more than 40 security videos carrying bombs in suitcases to Manhattan targets with “deadly intent” and shouldn’t get credit for the fact that no one died, a prosecutor said Thursday as summations in the New Jersey man’s trial began in Manhattan federal court.

“The defendant was proud of his bombs, proud of his plan,” prosecutor Emil Bove told jurors. “It was an act of war.”

Rahimi, 29, is charged with planting one pressure cooker bomb on West 23rd Street in September, 2016 that injured 30 people when it exploded, and another on West 27th Street that was defused before it could detonate. Rahimi is charged separately in New Jersey with planting bombs there.

Bove, who had to be warned to back off by U.S. District Judge Richard Berman when he walked over to deliver part of his closing only inches behind Rahimi, said it was sheer luck that kept the alleged bomber from killing his intended victims on busy city streets and at a charity race in New Jersey.

“Only acts of grace saved them from this man’s violent ideology,” the prosecutor said. “ . . . There is no miracle defense. It’s not a defense that no one died.”

Jurors are expected to begin deliberations on Friday, after a defense closing, prosecution rebuttal and instructions from the judge. Rahimi, an Afghani-American from Elizabeth, New Jersey who worked at a family chicken restaurant, could face up to life in prison if convicted on the 8-count indictment.

Bove’s closing wove together an array of evidence from the 2-1/2 week trial, including bomb-making plans on Rahimi’s laptop, purchase records of materials used in the bombs and DNA linking him to the explosives, and jihadist sentiments in a notebook found when he was captured.

The prosecutor said 45 security videos showed a man who resembled Rahimi delivering suitcases with his bombs to the Chelsea sites on Sept. 17. More than 20 fingerprint matches linked Rahimi to the bombs, said Bove, who showed jurors a picture of a smiling Rahimi from two days before the bombing.

“Look at how happy that man is,” Bove said. “He couldn’t be happier.”

The summation came after prosecutors called their final witness Thursday morning, Tsitsi Merritt of Harlem, who described how she and her son, 11, were shaken by the detonation on West 23rd Street while they were stopped at a traffic light in a friend’s Toyota.

Merritt, one of more than a dozen victims to testify, began crying as she watched a surveillance video showing the car at the moment of the blast, She said the blast felt like an “earthquake” and shattered windows in the back where her son was sitting as other bystanders ran and screamed.

The scene was “kind of hysteric,” Merrit said.

“I was telling my son ‘you’re OK, just calm down. You’re ok,’” she said. “ . . . My ears were ringing, a lot of vibration going on in my head. I felt like I had an alien head. . . . I couldn’t really grasp how I was feeling.”

The defense, after a half-hour consultation with Rahimi, rested without offering testimony from him or any other witnesses.