Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Chicago, which had more murders in the last two years than any American city, may finally be bringing the violence under control.

Promising crime statistics have been rolling in, sparking hope that the worst may be over — despite occasional spasms of shootings like one last weekend in which more than 40 people were shot, including a federal agent assigned to a gun violence task force.

Homicides and shootings have declined for 14 consecutive months in Chicago, and were down by about 20 percent through the first week of May, according to police statistics. The reductions in the city's South Side — where economic isolation and gang activity has driven runaway crime rates — are even more dramatic.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"In the last year or so, I can definitely say it's much quieter — as I prefer," Asiaha Butler, who lives in the South Side neighborhood of Englewood, told NBC News. "But also, more of a sense of community." Shootings in Englewood are down 52 percent, and murders are down 41 percent, through May 6, compared to the same period last year.

Police respond to a scene at a bodega in Chicago. NBC News

The key to this apparent turnaround, according to police and community leaders, is a combination of high-tech and old-school tools.

First, Chicago deployed crime-prediction software, gunshot-detection devices and dozens of surveillance cameras that pour data into station-level processing hubs called Strategic Decision Support Centers. The system, supported by the University of Chicago Crime Lab and modeled after a program in Los Angeles, helps officers respond more quickly to shootings, identify suspects and flood areas where more crime is expected.

That added precision, police say, makes indiscriminate stop-and-frisks less likely, and builds upon the second piece: improving the department's fractured relationship with the public.

"The technology, of course, has helped, but you still can't replace the human piece of it, the human intel," Police Superintendent Eddie Johnson said in an interview with NBC News. As a result, he said, "the community has come back to engage with the police department."

The distrust exploded into public view in 2015, after a judge ordered the city to release video of the police shooting of 17-year-old Laquan McDonald. The video exposed officers' attempts to cover up wrongdoing and led to an investigation by the U.S. Justice Department, which resulted in a report that documented years of systemic civil rights violations by the country's second-largest police department.

The city is still negotiating a program of reforms. The violence-fighting initiative has put more officers on walking beats and solicited advice from community groups.

Corie Luckett, owner of Englewood Branded, a new printing shop, said police still have a long way to go, including having more officers walk beats and engage with citizens. But Luckett also said that the efforts so far are working, mainly because the public wants them to.

"We are not fighting," he said. "We're trying to resolve the issues as peaceful and positive as possible."