The District ended 2019 with the highest number of homicides recorded in a decade, continuing an upward trend in killings fueled by what authorities say is a proliferation of the use of firearms to resolve disputes.

A total of 166 people were slain in the city last year, a slight increase over 2018. The last time the District had this many homicides was 2008, when 186 people were killed.

For a second consecutive year, there was particular concern over the number of young victims, with a dozen school-age children and teenagers fatally shot or stabbed. One of those shot to death was an 11-year-old boy.

D.C. Police Chief Peter Newsham and other city leaders are frustrated that the deadly violence has continued despite the city’s efforts to put resources into troubled neighborhoods. The chief said that overall violent crime has been cut nearly in half over the decade and that the District has become a safer place but that “one homicide is too many in our city.”

Police said many of the killings have been the result of conflicts between acquaintances, crimes that are difficult to stop with traditional policing strategies aimed at calming neighborhood disputes or battles over turf. Other high-profile killings have been random attacks involving suspects who court documents show have a history of mental illness.

Newsham blamed easy access to illegal guns as a main driver of the city’s violence. He said about half the people arrested in homicides have prior gun arrests.

Criminologists said the District is mirroring other large cities with swings in deadly crime. Cleveland, Detroit, Memphis and Jacksonville, Fla., had increases, and Baltimore set a high for its homicide rate. New York, which hit a half-century low in homicides six years ago, is showing an increase for 2019.

In the Washington region, Prince George’s County also had an increase in killings. Homicides investigated by county police jumped more than 20 percent, to 74 in 2019, compared with 60 the previous year. Homicide rates in Montgomery County and Northern Virginia jurisdictions remained low. In the District, 2019 began violently. The city recorded eight homicides, including several shootings, in the first eight days of the year.

Leaders pushed to respond, continuing to expand programs to resolve street conflicts before they get out of hand or offer job training and other opportunities to those at risk. The U.S. attorney’s office announced it would prosecute more gun crimes in federal court, instead of in D.C. Superior Court, as part of a citywide crackdown on repeat violent offenders and felons found illegally possessing firearms.

Prosecutors said that since the initiative began in February, 114 people have been indicted on charges of being felons illegally possessing firearms. Forty-six have pleaded guilty or been found guilty at trial; the remainder of the cases are pending. Officials were unable to provide comparative statistics from 2018, and sentencing data was not available.

In May, Maurice Scott, 15, was killed trying to flee bullets fired at someone else, leaving his twin sister, younger by 60 seconds, without her closest confidant.

Two months later, 11-year-old Karon Brown was shot trying to flee a dispute involving adults and other children outside a gas station. “This is not normal,” the Rev. Thomas Lee Cardwell Jr. said as he delivered Karon’s eulogy. “Something is wrong in Washington, D.C.”

In the span of six days in August, Robert Bolich, a 62-year-old bridge inspector, and Margery Magill, a 27-year-old dog walker, were stabbed to death in unrelated random attacks. In each case, court papers say the suspect told police the devil or dark forces prompted him to kill.

Magill’s father, Jeffrey Magill, a retired teacher who lives in California, said he is pushing the D.C. Council to improve services for the mentally ill. He also is advocating against an effort to allow more felons to seek early release from prison.

Urgency grew in October when eight people were killed in five days. The victims included a man with special needs and his caregiver, a 15-year-old stabbed aboard a Metro train and a groundskeeper shot during a robbery that occurred on his lunch break. At one crime scene, Newsham said he didn’t see shootings ending anytime soon, a remark inadvertently caught by a television microphone.

The candid assessment from the District’s top police officer captured a moment of unvarnished angst, which Newsham later attributed to the emotional toll of visiting so many homicide scenes in such a short time.

The chief used the moment to reiterate his long-standing position that gun offenders need to be held to stricter account. He said that “it is very disturbing” when repeat offenders are accused in killings and the public sees that “we are not appropriately dealing with them when we get them the first time.”

Newsham later said more guns with high-capacity magazines are being used in crimes. The city has also seen a higher percentage of shooting victims die of their injuries, officials said, and they have been working to understand why. Most of the killings occur in the city’s poorest neighborhoods.

D.C. Mayor Muriel E. Bowser’s administration, which had extended a summer crime initiative into the fall, has kept the effort going into the new year. Officials authorized additional overtime for police and brought back a retired assistant chief with decades of experience to turn around a sluggish homicide arrest rate.

Newsham said the anger over the killings “increases our resolve to do better next year.”

Bowser expressed confidence in law enforcement leaders but said, “I won’t be satisfied until every one of our neighborhoods feels safe.” She said she wants to get more people involved in alternative programs, but she also said she is pressing prosecutors and others in the judicial system “on making sure they are doing all that they can to make sure violent offenders are off the streets and not trying to hurt any resident of the District.”

The 2019 homicide count in the District does not include at least a half-dozen killings that were ruled justified, including the shootings of two men in a single incident and the death of a popular youth baseball coach on Capitol Hill after a fight.

It also does not include the Jan. 1, 2019, shooting death of a U.S. Marine at the Marine Barracks on Capitol Hill in which another Marine was charged with unpremeditated murder. That shooting was investigated by the military.

Overall, police say, violent crime has dropped markedly over the years in the city, even as the District’s population climbs. Violent crime has been nearly cut in half since 2008.

Even with the increase in killings, the numbers pale in comparison with the District’s most murderous years of the crack epidemic three decades ago. Since then, killings have fallen by nearly two-thirds.

The deputy mayor for public safety, Kevin Donahue, said homicides are not trending downward as violent crime generally has been and appear to be a “unique and separate category.” Many homicides, he said, are more akin to “crimes of passion” and present police with a unique and “stubborn challenge.”

Newsham said that a “large majority of our homicides are between people who know each other. They are not random in nature. . . . Many involve victims who are living very high-risk lifestyles.”

A Washington Post poll found that many D.C. residents feel affected by crime, even as a large majority said they felt safe in their neighborhoods. Nearly half of those who live in the poorest areas said they or someone they know has been threatened with a gun or has been shot in the past five years.

Criminology professor James Alan Fox, who has studied violence around the country for several decades, said the District is largely following the same patterns as many other cities.

Fox, of Northeastern University, said that the District in past years has seen “some ups and downs” in its homicide numbers but that if “you look at the long-term trend, the volatility is nothing like what you saw before.”

The numbers, Fox said, are “not signaling that we’re on an awful trajectory.”

Daniel Webster of the Johns Hopkins Center for Gun Policy and Research attributed the increases in homicides in many cities more to economic and social distress than to any one policing strategy. Echoing D.C. police, Webster, the director of the Johns Hopkins center, also cited the ready availability of firearms as a contributor.

In challenged neighborhoods, Webster said, “everything gets ratcheted up because people’s social status is so fragile and guns are more readily available than they should be.”

Bowser (D) created the Office of Neighborhood Safety and Engagement in 2017 to address violence outside the scope of law enforcement. “Violence Interrupters,” who seek to calm neighborhood tensions, are part of that agency, as is the Pathways program, which identifies people likely to be the next killers or the next to be killed, provides them skills training and finds them work. About 85 people have gone through training, and most are employed. The mayor plans to expand the program in 2020.

One of the latest killings in the District came on an afternoon two days before Christmas on Fourth Street in Southeast, around the corner from an elementary school and in front of the apartment complex in which the victim lived.

The circumstances of Tyshaun Turner’s shooting remain under investigation, and police have not commented on a possible motive. Authorities said they found bullet casings from two different-caliber weapons that might indicate a gun battle.

Turner, 27, worked since 2017 for New Columbia Solar installing solar panels on buildings. He had gone through a program created by the District called Solar Works D.C. that helps people in challenged neighborhoods to find jobs.

His bosses described Turner as an affable young man who was the hit at the office holiday party, persuading everyone to follow his lead to the dance floor, and a consummate jokester who supported his colleagues. He talked about his opportunities on Twitter and in a social media Q&A. In one, he is pictured wearing a T-shirt adorned with a map of the District, an orange vest and a hard hat.

“He was working hard,” said the company’s chief executive, Mike Healy. “He found something he was really passionate about, and he dedicated himself to it. . . . He was doing what the city wants people to do. He was making a better life for him and for his family.”

The company’s director of operations, Jorge Consuegra, said Turner rarely talked about living in Washington Highlands, one of the city’s most dangerous neighborhoods.

“We talked about the good things,” Consuegra said, “and how he could better himself.”

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