The seemingly unbridgeable chasm between the police and black Americans widened Sunday with what officials say was an ambush shooting that killed three cops and wounded three more in Baton Rouge, Louisiana.

Authorities said the shooter, Gavin Long, 29, was an African-American former Marine from Kansas City. He was shot and killed by police. The shootings followed the assassinations of five Dallas police officers by a black man who said he wanted to kill white people, especially police officers.

Those shootings followed the fatal police shootings of two black men, Alton Sterling in Baton Rouge and Philando Castile in Minnesota. The Dallas shooter cited their deaths in the killing of the officers.

And this past weekend, NYC police fatally shot a black man during an armed-robbery call in East Williamsburg.

This chasm between police and blacks is also reflected in Mayor de Blasio’s and NYPD Commissioner Bill Bratton’s public disagreement over Black Lives Matter, the protest movement many police believe has exacerbated tensions.

The mayor said last week the movement has “hit the right note” on police shootings. “Young men of color live in fear all of the time,” he said. But Bratton sees BLM as anti-cop. It “has focused its energy entirely on police,” he has said. “Yelling and screaming doesn’t resolve anything.”

Many officers feel blacks care more about police shootings of blacks than about blacks killing each other. Bratton recently noted that 38 percent of shooting victims don’t cooperate with police. “No one seems to be marching against that,” he said.

The comments led Councilman Jumaane Williams, a black Brooklyn Democrat, to ask Bratton to apologize “for the insinuation that we have to choose which violence we should accept.”

Black Lives Matter grew out of the fatal police shooting of Michael Brown, an unarmed black teen in Ferguson, Missouri. Ignored in the aftermath was that Brown had robbed a convenience store and when stopped by Officer Darren Wilson, he attacked the white officer and tried to grab his gun.

With no initial official story, many in the media accepted the accounts of eyewitnesses, who said Brown had his hands up when he was shot. And “Hands Up, Don’t Shoot” became a national mantra.