Often in police shootings, the carrying of a gun by the victim has become shorthand for whether it was justified. But experts and activists said that ignores an important point: whether someone was doing something threatening with the weapon.

While there is no data on whether legally armed white or black people are shot at higher rates in the United States, experts on implicit bias said that negative stereotypes of black people would suggest that they are at a greater risk of having their actions or intentions misinterpreted when they carry guns.

It is an issue with long historical roots. As far back as the 17th century, the British colonies expressly prohibited gun ownership among black people and Indians. Through Reconstruction, local judges and sheriffs administered gun permits in a racially discriminatory way. And when California’s Legislature banned open carry in the 1960s, it was in response to the Black Panthers’ openly wielding guns at the State Capitol.

But black gun advocates said that they should not be deterred from legally carrying firearms.

“I think there’s some social realities that take place when you are an African-American male and are open carry or concealed carry,” said Philip Smith, the president and founder of the National African American Gun Association. “You can’t worry about that. If I went around worrying about what everybody’s thinking as I’m carrying a gun on my hip, I would go crazy.”

Mr. Balogun helped found his Dallas gun club two years ago to organize and educate on the subject of gun ownership for blacks. When they openly carry their guns, they always try to travel in numbers or have a camera rolling. That is to ensure that witnesses can attest that they are not up to something nefarious.

“The thought of a black male with a weapon scares America,” he said. “They automatically fear that we’re seeking some form of vengeance. We’re not seeking vengeance. We just want to protect our community and our homes.”

It remains unclear exactly what happened in the shooting of Mr. Castile in Falcon Heights on Wednesday. But the authorities said that an officer stopped his vehicle for a broken taillight. After the shooting, Mr. Castile’s girlfriend began streaming live video on Facebook while he bled to death next to her and the officer trained his gun on the vehicle. In the video, the girlfriend said that Mr. Castile told the officer he had a licensed handgun. He reached for his wallet to give the officer his identification when the officer opened fire, she said.

Minnesota law allows people to carry guns with a permit obtained from a county sheriff’s office.

Mr. Castile’s killing came just a day after Alton B. Sterling, a black man in Baton Rouge, La., was fatally shot during an encounter with two police officers. Amid the scuffle, one of the officers said Mr. Sterling had a gun.