For a decade, Atif Mahr mentored young people, preaching the virtues of anti-violence even as the streets of his north St. Louis neighborhood echoed ever more often with the crack of gunfire.

Then one day last October, those bullets tore a jagged hole in Mahr's own family. His daughter Isis was dropping off a friend when a gunman unloaded on her car. The soccer standout, who had been saving money to pay her way through nursing school, was 19.

"I always feared it," Mahr said. "I never imagined it."

Isis's death filled him with hurt. The reaction from the community, however, gave him hope.

The past two years have been dreadful for public safety in U.S. cities as homicide numbers soared - in some cases to record levels. Experts say a constellation of factors is to blame, including the coronavirus pandemic's scars and a breakdown in trust between police and the communities they serve during the social unrest of 2020. But as 2022 kicks off, city leaders from coast to coast say the stars may be aligning in a very different way.

Flush with federal pandemic-relief funds, mayors are pumping money into crime prevention programs that have demonstrated early promise. Police chiefs are using advanced data to target places and people for intervention, even as they attempt to mend badly strained neighborhood ties. And communities such as Mahr's, tired of burying their own, are rising up against those most responsible for the deaths. The result, some officials and experts say, may be a golden opportunity to break the trend of spiraling violent crime.

"People have said 'Enough is enough,'" Mahr said. "They're ready to fight back."

Of course, ample challenges remain, including a flood of illegal guns, police departments stretched thin by attrition and a pandemic that continues to defy predictions of its demise. But evidence that the pendulum could be swinging toward safer streets is already visible in cities such as Boston, Charlotte and Dallas, all of which recorded significant reductions in homicides last year, according to their police departments - even as cities such as Chicago and Philadelphia drew far more attention for their continued surges.

And then there is St. Louis. An explosion of violence in 2020 gave the riverside city of 300,000 the worst homicide rate in the nation - and the highest on record in the city's history. But last year, homicides fell almost as fast as they had risen, dropping 26%, according to police crime data.

Mayor Tishaura Jones said that's no cause for celebration, given that nearly 200 people were killed. But to Jones, who was elected last spring, it is an indication that her strategy of addressing violent crime at its source - by reducing poverty, engaging young people and allowing police to focus their energies on the worst violent offenders - can achieve results.

"We're starting to see those efforts pay off," Jones said.

Whether the results can be sustained in St. Louis, and replicated in cities nationwide, is a subject of intense interest among criminologists and others in the trenches of crime-fighting. Mayors are increasingly staking their careers on getting it right: Eric Adams won election in New York on a pledge to cut violent crime, while Chicago's Lori Lightfoot, who faces reelection next February, has said this is "a make-or-break year" for halting the city's rise in homicides, which exceeded 800 in 2021.

The precise reasons crime rises or falls remain disputed, and the explanations for why some cities appeared to have bounced back following across-the-board spikes in 2020 are being studied.

"I wish I knew," said Richard Rosenfeld, a criminologist at the University of Missouri-St. Louis. "What explains the particular mixture of cities, some up and some down, remains to be determined."

But Rosenfeld, a member of the Council on Criminal Justice's Violent Crime Working Group, said a few things are already clear. One is that covid-19 and its associated disruptions may have lowered crime rates overall - property crime, for instance, has been substantially down - while stoking violent crime.

The homicide rate remains well below its peak in 1990s, but slayings hit 21,570 nationwide in 2020, according to FBI data, nearly 5,000 more than the year before. Complete figures from 2021 have not been released.

"There is little doubt that the sheer stress and strain of the pandemic, not to mention the economic dislocation, helped to push up homicide rates," Rosenfeld said.

If and when the pandemic eases, that could offer hope for reductions.

Also widely accepted, Rosenfeld said, is that certain crime-fighting strategies appear to be paying dividends. Among them: a laser focus on certain areas and individuals that are driving homicides, while also investing in the repair of police-community relations.

"That's the balance that's needed," he said.

It's a tricky one to strike, with the risk that homing in on "hot spots" ends up alienating those most needed to assist the police with their investigations. The harm of over-policing - particularly in majority-Black neighborhoods - was a key theme of 2020 protests following the murder of George Floyd by former Minneapolis police officer Derek Chauvin.

Police leaders nationwide say they are mindful of the risk. Columbus Police Chief Elaine Bryant said Ohio's capital city is betting heavily on Operation Unity, a program that uses data analysis, technological surveillance and old-fashioned intelligence gathering to target areas where violent crime is spiking. The program, she said, is a corrective to efforts that "cast too wide a net."

But as police zero in, she said the department is careful not to overly rely on arrests and other shows of force. The program also involves helping residents get substance abuse counseling or rental assistance to head off criminal activities before they start.

"We can't just police our way out of this," she said. "Anything that residents may need we try to make sure we connect them to."

Columbus is among a handful of cities that set a homicide record in 2020, only to see it eclipsed a year later as killings continued unabated, rising to 200 by year's end in the city of nearly 900,000.

Bryant, who was named chief last year, said the back-to-back spikes have triggered anger among residents - and a determination to produce a different outcome in 2022.

"Everywhere I go, people ask me, 'How can I help?'" Bryant said.

The department is trying to offer new answers, including a planned "citizens radio patrol" in which residents would be given the tools to patrol their own neighborhoods and communicate with police when trouble arises.

The idea - a modern-twist on neighborhood watch programs - is intended to "send a signal that the community cares about their neighborhood," she said. "You should be able to sit on your porch, ride your bike or walk to the corner store without being concerned about random crime."

In another similarly sized Midwestern city where homicides kept rising in 2021 - Indianapolis - Chief Randal Taylor said he, too, is focused on mending ties between the police and the community. It's the only way, he said, that his force can make a meaningful impact on a death count last year that hit 271 - the highest on record.

"We'll have a shooting, and all these people were there, but no one saw anything," Taylor said, citing what would-be witnesses tell officers. "Then we talk to community leaders and it's, 'Well, we just don't trust the police.'"

To rebuild trust, Taylor said he's focused on a strategy of transparency, even when the facts might reflect poorly on his department or individual officers.

"If we blow it, we're going to be up front with it," Taylor said. "That's the only way we can get people to feel confident in what we're doing."

Last year, for instance, an officer kicked a handcuffed homeless man in the face. Taylor said there had been no formal complaint, but the incident was caught on body-camera footage - which Taylor decided to make public.

The action earned the officer felony charges and a denunciation from Taylor, who called it "outrageous."

Police departments nationwide soon could have more money with which to improve community relations: U.S. Attorney General Merrick Garland told the United States Conference of Mayors on Friday that the Biden administration was asking Congress for a billion dollars worth of grants to support such programs in the 2022 budget.

But even the best community-police ties won't be enough to stop a category of violent crime that Taylor said he's seeing more and more. It's driven by the stress of the pandemic - or maybe just of modern life - and often involves people with no criminal record. It's seemingly random, impulsive and almost impossible to anticipate.

"We've had cases where people have been killed because of something they posted on social media. We've had people killed over parking spots," Taylor said. "This is my 34th year in law enforcement. A lot of things have changed. This one is perplexing and concerning."

So too, some experts say, is the lack of resources that some departments have at their disposal to combat violence.

While the "defund the police" movement yielded little in the way of actual budget reductions - and while debate still rages over whether having more police actually helps to reduce crime - departments have undoubtedly been stretched in a way they haven't in previous years.

"We've seen fewer officers, more officers out sick, less ability to hire and retain officers," said Travis Taniguchi, director of research at the National Police Foundation. "Agencies will tell you that they have less ability to investigate crime."

In Fresno, Calif., Mayor Jerry Dyer said he believes that is among the reasons killings in his city rose so dramatically - from 41 in 2019 to 74 each of the past two years.

Dyer, who was the city's police chief before he became mayor, said reducing that number is his highest priority for 2022. He thinks an infusion of new officers will help a department battered by attrition.

The city has about 850 officers for a city of more than a half-million residents, with covid eating into those numbers substantially in recent weeks as dozens of officers at a time enter quarantine or isolation. Dyer's goal is to get the number of active-duty officers above 900, a formidable task in such a tight labor market.

"Stimulating interest in joining the department has been a challenge," he said. "But I think that's changing."

Without sufficient officers, Dyer said commanders have had little choice but to be reactive - prioritizing response to 911 calls, for instance - rather than taking a proactive stance to "focus on gangs and go after the most violent offenders." The result, he said, is a cycle with no end.

"When you have shootings occurring in your city in large numbers and the criminals don't see police officers arresting or holding people accountable, more and more gang members start carrying firearms," he said.

Breaking that cycle is what got Kenyatta Johnson involved in community activism in Philadelphia. His cousin was murdered, and he responded by founding a group, Peace Not Guns, dedicated to curbing the violence.

Decades later, Johnson is a member of the Philadelphia City Council and chair of its committee on gun violence prevention. Its task is daunting: The city experienced 561 homicides last year - its highest total ever. Of those, 501 involved firearms.

“People have a sense of lawlessness in Philadelphia because of the number of shootings they’re seeing day in and day out,” he said.

But amid the gloom, Johnson said, there’s reason for optimism that 2022 can be better. One is that the city will have a victim advocate office that looks out for those mourning loved ones - and helps to make sure they don’t become the next perpetrators in endless rounds of retaliation.

Another is that the city has used pandemic relief funds to invest heavily in community resources such as recreation departments, libraries and neighborhood anti-violence groups - all of which can give young people something positive to do after two years of frayed connections.

"The pandemic really exacerbated some of the ills plaguing Black and Brown communities. Schools being shut down. Recreation centers shut down. People not being able to feed their families," Johnson said.

St. Louis has made similar investments. When crime was climbing in the city's downtown last summer, Jones, the mayor, said officials doubled down on giving young people alternatives: art programs, esports and other activities that she said helped to curb the rise.

The city has focused particular attention on its long-neglected north, spending on anti-poverty programs, mental health and housing - all of which, Jones said, can contribute to reducing violence.

"We have to address the root causes of crime that have left half of our city neglected for decades," she said. "We have an incredible opportunity to right these wrongs."

Mahr, of St. Louis, is part of that struggle. The 47-year-old has spent years volunteering with young people at a recreation center on the city's north side, and those efforts didn't stop when his daughter was killed. If anything, they intensified.

In the months since, he has led protests and marches to honor Isis, and found the young people he mentors more energized than ever in rejecting those who glorify the culture of violence. He is also coaching youth basketball and supporting his family with a full-time job.

“My plate is pretty full, even though every second of the day I hurt,” he said. “If I can stop one parent from feeling the way I feel, then I’m doing what I’m supposed to be doing for my daughter.”