As high-profile police shootings continue to shake the country, a growing number of Black police leaders are grappling with a crisis in their officers’ treatment of young men of color.

These police chiefs face high expectations, from their cities at large but particularly from minority residents within, as they work to attract a more diverse team of officers, curb deadly confrontations with the public they serve, and rebuild relationships with Black, Hispanic and other minority neighborhoods.

In interviews with NBC News, several Black police executives spoke about their personal and professional experience in confronting the problem of police disproportionately targeting minority communities, an issue with deep institutional roots.

“Diversity is important and valuable, but it can’t be separated from the police culture, from the way we view what our job is, the way we view the community and the way we are viewed by the community,” Sacramento Police Chief Daniel Hahn said. “It’s a complicated problem that takes a nuanced solution.”

Police departments have been struggling for decades with allegations of racism and issues of brutality and trust, and with becoming more diverse. But protests in 2014 after two Black men, Eric Garner in New York and Michael Brown in Ferguson, Mo., died in confrontations with white officers, and riots a year later after another Black man, Freddie Gray, died of wounds suffered in the custody of Baltimore police, touched off a renewed sense of urgency. Researchers have found that having significantly more Black officers could ease tensions between police and Black communities, while others found that increasing the number of Black officers may drive down police killings of Black people, but only when Black representation on the force reached a “sufficiently high” critical mass of 35 percent or more. Nationally, the most recently available government report from 2013 found that local police departments were 12 percent Black and 73 percent white.

What diversity alone does not solve are the biases many officers bring to their work –perceptions of Black men as more threatening, for example – which are heightened by a police culture that emphasizes strength and power. That drives racially disparate arrests and the use of force, researchers say.

Philadelphia Police Commissioner Richard Ross also defended his officers, saying those involved in the recent Starbucks arrests “did absolutely nothing wrong.”

But after facing a torrent of criticism on social media, he later apologized to the two men who were arrested, and for his choice of words immediately after the incident, saying he had inflamed the situation. Ross, 54, who became commissioner in 2016, stressed in a Facebook video after the incident that his officers were trained to prevent biased behavior and learn the history of “atrocities committed by policing around the world.” He also promised to examine the Starbucks case to see “what we can do better.”

Hahn said he was troubled by the notion, expressed in many Black neighborhoods, that “when you’re blue you’re not Black anymore.” That “erases” his upbringing and identity, he said, and undermines the goals of increased diversity.

“There are bad Black officers, bad gay officers, bad female officers,” Hahn said. “Just because you’re a certain race or have a certain experience doesn’t automatically mean you have the character to be a good police officer.”