As a beat cop, Dave Kerner wanted to build trust in the Florida communities he patrolled. But like every other police officer he knew, he was constantly on guard for an attack. That fear, which he says was instilled at the police academy, affected nearly every interaction he had with the people he had sworn to protect, often making encounters unnecessarily tense and adversarial.

Kerner, now a Democrat in the state House of Representatives, says in an interview with The Trace that the anxiety was made worse by the knowledge that so many of the people he encountered on the job were armed — legally and illegally — with guns. Florida has over 1.6 million concealed carry license holders, more than any other state.

The preponderance of firearms affected officers’ mindset when on patrol, Kerner says. “Stress levels go up, which not only has a negative effect on an officer as a whole, but also hurts any interaction between law enforcement and the community.”

It was difficult for officers to prioritize having positive, de-escalated encounters with civilians, “because we’re constantly evaluating whether the person we’re interacting with has a weapon,” he tells The Trace.

Fear of getting shot — real or perceived — contributed to two high-profile police shootings this week, as white officers fatally shot black men with guns in Louisiana and Minnesota. Though the full details of each shooting are not completely clear, neither man appeared to be threatening officers with a weapon. Philando Castile, the Minnesota victim, had a clean record, a concealed carry permit, and was a beloved figure in the elementary school where he worked as a cafeteria supervisor.

On Thursday night, a peaceful protest march in Dallas over the killings turned tragic, when a gunman armed with a semiautomatic rifle ambushed police officers, killing five and wounding seven. The shooter, Micah Johnson, told police negotiators that he was targeting white people, especially white police officers, according to the Dallas police chief.

In targeting Dallas police, the shooter chose a department that has made great strides in reducing conflict by embracing new policies intended to de-escalate tension in encounters with civilians. The strategy, which a handful of other departments have also adopted, is intended to reduce the conflict that Kerner described between officers and civilians by respecting the civil rights of the latter — without making officers any less safe.

While the de-escalation strategy has shown promising results in Dallas and other cities that have embraced it, the fact remains that guns make even well-trained police officers nervous. And nervous cops are more likely to make a deadly mistake.

While the vast majority of encounters between police and armed civilians are resolved without violence, more guns in public mean more chances for an interaction to lead to a police shooting.

“Police have always been trained to look out for people carrying guns,” says Laurie Robinson, a George Mason University criminologist who co-chaired the White House Task Force on 21st Century Policing. “With the passage of all the concealed carry laws, the equation has changed.”

Since the 1980s, the National Rifle Association has lobbied aggressively to loosen laws restricting who can carry guns in public, and where they can carry them. The number of concealed-carry permit holders in Ohio, for example, recently topped half a million, and the New York Times reported that, as of April 30 of this year, there were slightly more than a million concealed carry licensees in Texas; 535,000 in Washington state; and 276,000 in South Carolina.

De-escalation is intended to defuse encounters between police and civilians, whether a gun is involved or not.

Most criminologists credit a law enforcement think tank called the Police Executive Research Forum, or PERF, for introducing the idea of de-escalation to American policing. PERF developed the principles after observing the work of Scottish police, who, notably, don’t carry guns in a nation where private gun ownership is strictly curtailed.

The strategy teaches police to defuse tense situations by maintaining their distance from possibly dangerous people, establishing a rapport with suspects instead of acting aggressively, and slowing down confrontations rather than resolving them as quickly as possible.

It’s believed that not only will these tactics prevent unnecessary civilian deaths, they also keep officers safer.

Dallas Police Chief David Brown has credited the de-escalation approach with drastically reducing the number of complaints about his officers’ use of force. Excessive force complaints fell from 147 in 2009 to just 13 in 2015.

Despite these promising signs, many in law enforcement remain skeptical. Jim Pasco, the head of the Fraternal Order of Police, warned departments earlier this year against adopting the Scottish-born strategy. “We’re not going to stand by and let police officers be sacrificed on the altar of political correctness,” he said.

Thomas Abt, who studies crime policy at Harvard’s Kennedy School of Government, says many cops oppose de-escalation because it refutes many commonly accepted police practices. “Police are trained to establish immediate control of a situation,” he tells The Trace. Waiting for people to calm down, he says, is seen as simply increasing the chances that an officer or civilian will be hurt.

The presence of a gun complicates de-escalation, agitating officers and making it difficult for them to take a measured approach to confrontations. “We have to recognize that when guns are involved, tensions will be higher, and when mistakes are made, they will be much more costly,” he says.

In a February report on the PERF program, reform advocates said that when a policeman is specifically threatened with a gun, “the officer generally has limited options besides deadly force for stopping the threat.”

But what, exactly, counts as threatening behavior?

Mike Briggs teaches classes for Minnesota concealed carry license applicants. Briggs instructs his students to follow a simple protocol if they are carrying a weapon in a situation like a traffic stop. “In our class, we say start by telling the officer, ‘I have a permit to carry and I have a gun. What would you like me to do?’”

He advises students to keep their hands on the wheel (“at 10 and two”) unless they receive specific instructions otherwise. Briggs says if concealed carriers are courteous, follow instructions, and provide their carry licenses, traffic stops should be uneventful.

But even following all of an officer’s orders does not guarantee a good outcome — especially for African Americans.

In a cellphone video taken immediately after Castile was shot, his girlfriend Lavish Reynolds said he cooperated with the officer’s instructions and volunteered that he was a concealed carrier, much as Briggs advises his own students to do. The officer shot him four times anyway, saying in the video Castile moved when ordered to stay still.

Darrell Miller is a Duke University law professor who studies civil rights and published a paper on how the Second Amendment is applied in encounters with police. He watched Reynolds’ video, and while noting that the crucial few moments leading up to the officer’s decision to fire are missing, it appeared to Miller that Castilewas doing what he’s supposed to do: Telling the police officer he was armed, cooperating with instructions.”

Additional reporting by Mike Spies.

[Photo by George Frey/Getty Images]