At times they find themselves defending police procedures to fellow blacks who see them as foot soldiers from an oppressive force. At other times, they find themselves serving as the voice of black people in their station houses, trying to explain to white colleagues the animosity many blacks feel toward law enforcement. Life for black officers, many say, has long been a delicate balancing act.

But in departments across the country, black officers say that act has become much harder after a season of intense protests against police shootings, followed by the killing of the New York officers. What are black officers who support the sentiments of antibrutality protests supposed to say to colleagues who blame the deaths of Officers Wenjian Liu and Rafael Ramos in New York on those very same protests?

“Everyone’s almost pretty much walking on eggshells,” said Sgt. Darren R. Wilson, who is the president of a union that represents mostly black officers in St. Louis, and who shares the name of the white officer who shot Mr. Brown in Ferguson. “What’s going on in the community today? How are we going to act and respond to it? What’s proper? What’s improper?”

Nowhere is that tension more palpable for black officers than in New York. Detective Yuseff Hamm, who wanted to be a police officer since he was a child in Harlem, said he initially could sympathize with people protesting the killing of Mr. Garner, who died after an officer placed him in a chokehold in July.

But the ambush killing of the two officers on Saturday changed his view. “In the beginning you could understand it,” said the detective, who is also president of the Guardians, a fraternal organization of black New York City officers. “But now, actively threatening to hurt a law enforcement officer and actually carrying it out — we’re in a difficult time right now.”