Friends, neighbors, family members, schoolmates and city officials raised candles and shout the name “Zaire” while gathered at a September vigil for Zaire Kelly, 16, who was killed in the District. (Astrid Riecken/For The Washington Post)

Homicides decreased last year in the District and in much of the Washington suburbs, but 2017 included a disturbing number of teenagers killed.

Some teens died in particularly brutal attacks linked to violent street gangs. Others were slain in random encounters — a boy shot during an apparent robbery of his new Air Jordan sneakers in Southeast Washington, a college-bound girl in the District hit by a stray bullet and a 17-year-old Reston girl attacked by a stranger as she walked to a mosque during Ramadan.

In all, the Washington region recorded 259 homicides in 2017 as the year was nearing a close Dec. 31, down from 300 in 2016.

Homicides decreased in other cities as well, including Chicago, which had seen a two-decade high in 2016, and in New York City, where 286 people had been killed as of Dec. 28, a level not seen since the 1950s.

Baltimore continued its surge in killings since the 2015 death of Freddie Gray, who was fatally injured in police custody, which set off riots, recording 343 homicides as of Dec. 29. That includes the unsolved shootings of two police officers — a Baltimore homicide detective killed while investigating a triple shooting and an off-duty D.C. police sergeant who lived in the city and was killed there.

Baltimore, with a population of 620,000, set a per-capita record and had more killings last year than did New York City with its 8.4 million residents.

Across the Washington region, grieving friends, relatives and others voiced a shared sentiment that too many promising young lives vanished with the pop of a gun, the thrust of a knife or the pounding of a fist.

"No one thinks about this kind of thing until it happens," said Omer Gorashi, a friend of Nabra Hassanen, the 17-year-old killed during Ramadan in Fairfax County. "You think, 'What if it was me?' "

Hundreds of friends and supporters of Nabra Hassanen rallied outside the Fairfax County Courthouse in Virginia in October. (Matthew Barakat/AP)

Seven youths ages 16 and 17 were slain in the District, including Zaire Kelly, a high school senior at 16 and aspiring chemist, who was shot confronting a robber, and Jamahri Sydnor, a police sergeant's 17-year-old daughter, who was struck by a stray bullet days before she planned to head to college in Florida.

"They were the future of what the District of Columbia should look like," said D.C. Council member Kenyan R. McDuffie (D-Ward 5), whose ward includes the neighborhoods where each was shot.

Homicides fell in the District from 135 in 2016 to 116 in 2017. That returns the city to a level seen before a spike two years ago.

Killings also dropped in Prince George's County, from 98 to 79.

Homicides held steady at 18 in Fairfax County and in Montgomery County rose to 21 in 2017, from 16 in 2016. Both jurisdictions struggled with violence wrought by the MS-13 street gang, or Mara Salvatrucha.

In Prince William County, which saw a record 22 slayings in 2016, four people were killed last year.

"I'm very pleased with the progress we've made in the city," said D.C. Police Chief Peter Newsham, noting factors that drove double-digit declines in violent crime and most property crimes. "The recipe is a lot of things — it's opportunity, education, properly treating substance abuse and mental health issues. It's appropriately dealing with our violent offenders. All of this plays a role in really having a safe city."

D.C. Police Chief Peter Newsham and Mayor Muriel E. Bowser speak about homicide arrests on Dec. 28. (Salwan Georges/The Washington Post)

Mayor Muriel E. Bowser (D), who saw homicides spike in her first year in office in 2015, has watched two consecutive drops and noted the impact of programs to intervene in disputes and shortly after shootings to prevent retaliation, as well as the involvement of agencies other than police in mitigating violence. But, she said, "we aren't satisfied with any level of violence in our neighborhoods."

Among the city's homicides was that of Zaire, who was headed home from a college prep course when he confronted a man attempting to rob him in a sliver of a park that was steps from his front door in Northeast Washington. Zaire stabbed the robber with a pocket knife, according to police, who said the robber shot the teen in the head. Both died.

Hundreds came to the park off W Street for a candlelight vigil to honor the standout scholar and track athlete who wanted to run for class president at Thurgood Marshall Academy — teachers, parents, his twin brother, fellow runners and his elementary school crossing guard.

"I'm sick and tired of coming together this way," McDuffie, the council member, told the crowd. "Zaire was not in the wrong place at the wrong time. Zaire was doing everything right. He could have been the next council member for Ward 5. He could have been the next mayor. He could have been president. . . . How many of you are sick and tired?"

A voice came from the crowd: "Then do something about it."

McDuffie answered: "His spirit and his light has to continue to shine. The community has to solve these problems. . . . This is our city."

In neighboring Prince George's County, police counted seven homicide victims between the ages of 13 and 18. One was a 17-year-old who police said was shot by his mother in the basement of their home during a dispute over video games. Many of the county's shootings occurred on the border with the District, where this summer there were 10 killings in 14 days. Prince George's Police Chief Hank Stawinski quickly deployed extra police in an initiative called Operation Domino to quell the violence.

The chief called about one-third of the county's homicides the result of "senseless" disputes, many arising among people who knew each other.

One man who felt he was waiting too long in the line of a drive-through liquor store pulled out a gun and fatally shot another customer. Two men were fatally shot after an argument over fireworks too close to a car.

Domestic-related slayings, which in past years made up a significant portion of the county's homicides, decreased by about half this year, to 12.

A man was accused of strangling his stepfather and snapping a photo of himself next to the corpse, which was posted on Twitter.

Another man was charged with the stabbing of his 6-year-old sister and two cousins, ages 6 and 8.

Nadira Withers, 6, and two young cousins were stabbed to death by her brother, Antonio Williams, prosecutors allege. (N/A/Family photo)

Antonio Williams is accused in the deaths of his young sister and two cousins. (Prince George's County Police)

In Fairfax County, it appeared the jurisdiction might end the year with fewer killings than the 18 in 2016. But a pair of slayings, in which a young man is accused of killing his girlfriend's parents, made 2017 a match at 18, a department tally stated. The victims' family said the parents tried to stop the youth from seeing their daughter citing what they said were his neo-Nazi beliefs.

In Montgomery County, detectives in court filings laid out gruesome details in a death they assert was linked to MS-13, with a victim lured deep into the woods of Wheaton Regional Park, where attackers choked and stabbed him more than 100 times, cut off his head, ripped out his heart and buried him in a grave they had dug.

Yet it was more often the year's killings of teens that drew at times nationwide attention because of the victims' youth or the circumstances around their deaths.

Vigils in a number of cities, for example, followed the death of Nabra Hassanen as she and friends walked to a Northern Virginia mosque.

A cellphone video captured the gang killing of 15-year-old Damaris A. Reyes Rivas of Gaithersburg, right, shown with her mother, Maria Reyes. (N/A)

A cellphone video that captured the killing of a 15-year-old from Gaithersburg beaten and stabbed in an MS-13 revenge slaying in Fairfax brought that case interest across jurisdictional lines.

Suspected gang retributions drew attention in a complicated scenario of rivalries and betrayal laid out in allegations in the deaths of a 17-year-old from Falls Church and a 14-year-old from Alexandria, apparently killed by MS-13 and buried in Fairfax County's Holmes Run Park.

And in Montgomery County, as the year ended, Adi Najjar continued to mourn and miss his only child — killed in June mere hours before he was scheduled to walk across a stage for his high school commencement.

The father said he lost his future when his 17-year-old son, Shadi Najjar, was fatally shot along with a companion.

"Our lives revolved around him," said Adi Najjar. "Our future was his future."

Lynh Bui, Justin Jouvenal and Dan Morse contributed to this report.