When city leaders in Boston set out last spring to renew their focus on violence prevention, they set a modest goal: reduce homicides by 20 percent in three years.

No one imagined what the city of 650,000 has seen so far this year: four homicides, a 78 percent reduction from the 18 that took place over the same period in 2023.

Luck has played a part, the normal ebb and flow of violent crime. Yet the longer the quiet has persisted, the more pressure the city has felt to sustain it. As summer set in with a blistering heat wave, anxiety rose. Will a seasonal uptick in violence shatter the preternatural calm?

“We’re not even halfway through the year, and I get superstitious,” Michael Cox, the Boston police commissioner, said in a recent interview, acknowledging his reluctance to talk too much about the phenomenon. “But we are doing so many things, and hopefully it is having an impact.”

City and police leadership are quick to acknowledge that the remarkably low number of homicides is not all their doing, and that bigger forces are at work. Large cities across the country saw violent crime decline in the first quarter of this year, part of a continuing downward trend after an alarming spike during the pandemic.

Boston’s smaller population, relative to other major cities, helps narrow the scope of violence prevention efforts. There is also a strong local foundation for such work, dating to the 1990s, when academic researchers, clergy and community leaders worked together to drive change so transformative, the “Boston Miracle” captured national attention.