People take part in a prayer vigil at Thanksgiving Square Friday in Dallas. Five police officers are dead and several injured following a shooting during what began as a peaceful protest in the city the night before.

Atlanta — At the end of a tough week for the United States, the big question for the country is, “So, what happens now?”

That’s how Tracey Meares, a Yale law professor and member of the President’s Taskforce on 21st
Century Policing, puts it. The future of democracy, “that’s what’s at stake here,” she says.

The sniper attack on police in Dallas, in which a US Army veteran killed five officers and wounded seven more, shocked the country. So did the tragedies this week surrounding two black men in Louisiana and Minnesota, whose seemingly senseless deaths at the hands of police were captured on cell phones.

As condolences poured in from around the world in the wake of the deadliest United States attack targeting police in nearly a century, there is great concern that building distrust could tear the country’s social fabric.

But police officials, from the Dallas police chief mourning his officers to the head of the NYPD police union, on Friday called for an end to “this divisiveness between our police and our citizens.” There is an equal opportunity, legal experts say, to build on an outpouring of support for law enforcement in the wake of the Dallas attack.

“We need to start some place to work together,” says New York Police Department Sgt. Ed Mullins.

As he plans a summit with black leaders “to resolve the situation that is occurring,” Sergeant Mullins, president of the NYPD Sergeants Benevolent Association, says he’s telling officers “to remain vigilant, to go to work with a heightened level of awareness, and they need to protect themselves … [a]nd somehow, hopefully, to make changes.”

The Dallas attack may present a new opportunity for Americans to think more deeply about addressing systemic problems without pinning blame on random officers, the vast majority of whom do a good job every day protecting all kinds of different American neighborhoods.

“When there is something as horrific as what we saw in Dallas – a domestic terrorist attack – our institutions are so strong and by and large enjoy such a high degree of legitimacy, that whatever this person intended is going to have the opposite effect,” says Robert Kane, a Drexel University criminologist and author of “Jammed Up: Bad Cops, Police Misconduct and the New York City Police Department.” “Whatever problems there are in American policing, what happened in Dallas is not the answer. We can criticize [the police] and ask police departments to do a better job, but that doesn’t mean we compromise our values and come after the situation in a violent way, which is counterproductive and tragic at the same time.”

Running toward the shooting

Videos of the attack show officers running toward the gunfire to help citizens.

Sharay Santora, who was there with her children, told CNN she overheard marchers say, “They were here for us, I’m going to be there for them.”

“My children and I are going to be there for their funerals because they lost their lives protecting me and my children,” she said.

People “need to open their minds to what is really occurring,” says Mullins. “If they can take a minute out of their day to think about the freedom that they have, what their life is like, to walk the street, to sleep at night inside their house, to go to work to get on the train to the next destination, how they’re able to do that on a daily basis without anything happening to them, and then ask, why is that possible? And the answer is, because police are out there now. And hopefully that will open their minds and their hearts to a different view, to start supporting the police officers.”

Since the deaths of Michael Brown in Ferguson, Mo., and Eric Garner in New York, police have expressed concerned that social unrest over the deaths of black men could descend into targeted violence. Two police officers were injured in a shooting after a grand jury failed to indict the officer responsible for Mr. Brown’s death. In 2014, two New York Police Department officers were killed in their squad car in a “revenge killing.”

In a response to the Dallas assassinations, the NYPD ordered officers on Friday to pair up for safety. “There are to be no solo foot posts citywide,” an internal memo read. “All meals and personal breaks will also be taken in pairs.”

As with many Americans, police officers across the country are already struggling with shifting dynamics overlain with fear and danger.

“When events like this happen – the absolutely tragic deaths of five police officers at the hands of a sniper – of course, policing agencies are going to be unbelievably reluctant to do this necessary work, of change,” says Professor Meares.

The call for an end to division and distrust extended to social media, where Robert F. Kennedy’s 1968 eulogy for the Rev. Martin Luther King Jr. was being extolled as more relevant than ever in the face of the Dallas attacks.

“What we need in the United States is not division; what we need in the United States is not hatred; what we need in the United States is not violence and lawlessness, but is love, and wisdom, and compassion toward one another, and a feeling of justice toward those who continue to suffer within our country, whether they be white or black,” Mr. Kennedy said, after quoting the Greek poet Aeschylus. “Let’s dedicate ourselves to what the Greeks wrote so many years ago: to tame the savageness of man and make gentle the life of this world. Let us dedicate ourselves to that, and say a prayer for our country and for our people.”

'We will be here'

On Friday, police across the country also braced for a barrage of well-wishes. When police are killed or hurt on the job anywhere in the US, the typical reaction, according to past interviews with police officers, is for Americans to give their local beat cop a wave, or even a hug. Such an outpouring had already begun on Friday morning.

The Bangor, Maine, Police Department urged residents who felt motivated to show their care and support to make sure to send any gestures of good will to the Dallas Police Department.

“The dead and injured officers have families and kids. We do too, but they need you more right now. Much more. When you see us, all you need to do is say hello. We like that very much. The good always wins. Trust me,” the department wrote on its Facebook page, before ending with its traditional sign-off. “Keep your hands to yourself, leave other people's things alone and be kind to one another.