Eighteen people have been indicted in connection with 12 separate shootings that killed two teens and injured eight bystanders, Brooklyn prosecutors said Wednesday.

Many of the accused shooters and the shooting victims were teenagers. Prosecutors said solving crimes involving young teens is part of an effort to prevent future gun violence, and added that prosecuting these cases helps end a cycle of retaliation between groups.

Most of the alleged shooters, aged 14 to 21, were connected with offshoots of the Bloods gang, Brooklyn District Attorney Eric Gonzalez said. Prosecutors charged them with murder, attempted murder and gun possession.

“We can’t give up on our youngest offenders,” Gonzalez said.

Prosecutors said the investigation began in August 2021 after a group of people shot someone in the face in a case of mistaken identity. The people charged in that crime were connected to a group called H-Block, named after Herkimer Street in Bed-Stuy, and mistook someone’s car for that of a rival gang member, according to Craig Edelman, deputy inspector of the NYPD’s gun violence suppression division.

They pulled up to the car's driver and shot him in the face, and “by the grace of God he survived,” Edelman said.

Later that same night, the group went on to shoot their intended target, 16-year-old Jaquan Gause, in the head, killing him, Gonzalez said.

“What should’ve been a quiet summer evening … became a nightmare,” Gonzalez said.

In 2022, the group shot and killed a second 16-year-old, Nayshawn Campbell.

Prosecutors said 11 of the alleged shooters pulled a trigger more than once, and six pulled a trigger three or more times. Officials recovered 15 guns linked to the victims, who were aged 16 to 40.