Residents watch as police investigate the site of a shooting on July 2 in Baltimore.
CNN  — 

Three teenagers pleaded guilty Monday to charges relating to a shooting at a Baltimore block party last summer that killed two people and injured 28 others, according to prosecutors.

Two of the defendants, ages 15 and 16, pleaded guilty to first-degree assault and being a minor in possession of a handgun in connection with the July 2 shooting in the south Baltimore neighborhood of Brooklyn, state’s attorney’s office spokesman James Bentley told CNN.

As part of a plea deal, the teens were sentenced to serve five years in detention followed by five years of supervised probation, with an additional 20 years in detention suspended, Bentley said. CNN is not naming the defendants because they are minors.

A third defendant, Mikhi Jackson, who was a minor when the shooting happened but is now 18, was charged with being a minor in possession of a firearm and was sentenced Monday to serve one year in prison followed by two years of supervised probation, according to Bentley. An additional four years of his prison sentence were suspended.

A fourth defendant, 18-year-old Tristan Brian Jackson, is awaiting trial on seven counts each of conspiracy to commit first-degree murder and attempted murder, as well as 41 other charges.

The shooting disrupted an annual neighborhood celebration known as Brooklyn Day. Aliyah Gonzalez, 18, and Kylis Fagbemi, 20, were killed and 28 others had gunshot wounds, police said. Most of the injured ranged in age from 13 to 19, police said.

Warren Brown, an attorney for the 15-year-old defendant, said the teen still is processing the sentence and is aware he has been given a second chance others may not have been offered.

“He is 15 years old. What does he know about anything?” Brown said. “The situation that this kid is in is the situation that thousands of people like him are in here in Baltimore and so many other places. It’s the guns. There is a proliferation of guns in a lot of urban areas and when these young people have access to these guns havoc ensues.”

“He just wants to go home to his grandmother who raised him,” Brown said.

Brown said prosecutors did not provide sufficient evidence to show his client shot anybody, but did show evidence he fired multiple shots into a group of people, causing them to flee.

CNN has sought comment from attorneys for Jackson and the 16-year-old defendant.

Mikhi Jackson, in addition to his year in prison and two years of probation, will be required to participate in a community violence intervention program organized by the local organization Roca, which says it aims to work with 16- to 24-year-olds in Baltimore to address cycles of violence, incarceration and racism.