Last July, Cook County State’s Attorney Anita Alvarez explained why she chose to charge police officer Dante Servin with involuntary manslaughter instead of murder for firing his gun into a crowd of people and killing 22-year old Rekia Boyd. Servin was inside a car, and fired the gun over his shoulder, claiming that he fired because he saw a man approaching him with a gun.

“He intentionally fired his weapon, yes. But is there intent to kill? I don't think he went out intending to kill anyone," Alvarez told the Chicago Tribune. "He was reckless, shooting off his shoulder into a crowd of people." Servin was set free after the judge angrily said that the entire case had been wrongfully charged.

How someone could fire a gun into a crowd of people and not intend to kill anyone is as much of a mystery as why it took Alvarez nearly two years to charge Servin. Similarly, Alvarez took more than a year to charge officer Jason Van Dyke for the shooting of 17-year-old Laquan McDonald, and only then after the government was forced to release video of the shooting that showed Van Dyke firing his weapon into McDonald’s body while he was lying on the ground. According to the Daily Beast, Alvarez declined to file charges against police involved in fatal shootings more than 68 times in the last seven years.

Alvarez lost her job Tuesday night. So did Timothy McGinty, the Cuyahoga County, Ohio prosecutor who told the grand jury looking into the shooting of Tamir Rice, a 12-year-old holding a toy gun, that they shouldn’t press charges against the officers who killed him because Rice’s death was merely tragic and not criminal. Though a video showed that Rice had been shot by police moments after they arrived, with no opportunity to even follow their commands, McGinty, by his own admission, encouraged the grand jury not to indict.

“Justice would not be achieved by bringing charges that would violate the ethical canons of our profession,” McGinty said last December, “because we know these charges could not be sustained under the law in our Constitution.” The local judge who ruled there was probable cause to bring charges against the officers described McGinty’s approach to the matter as “unusual.”

Both were unseated in Democratic primary contests, perhaps the first time we’ve seen prosecutors who shield police from accountability defeated at the ballot box. In both cities, activists worked to publicize their deference to police in fatal shootings of black men. That culture of deference is national — the Washington Post found that over the past 10 years, only an average of five officers a year were indicted for shootings. According to the Post, black men made up 40 % of the unarmed men shot by police last year.

The legal standards for prosecuting an officer are very high, because police can justify the use lethal force on the mere perception of danger, even if none is present. But prosecutors are also loathe to indict officers because they have to work with them, and because police unions can sway elections with money and votes. As New York Mayor Bill de Blasio has learned, the price of even mild criticism of police can be extraordinarily dear, and until recently, there was no strong countervailing force against the political power of the police.

Which is exactly why Alvarez and McGinty’s losses may be the most significant event since protests over Michael Brown’s death in Ferguson, Missouri, two years ago. It is the first time that the political power and influence of police unions have been checked at the ballot box over the refusal of prosecutors to treat unjustified fatal police shootings as serious crimes. Local prosecutors can weather protests. They know that the federal government, even if it intervenes, will not be there forever. But their careers cannot survive the wrath of an electorate that has decided that police cannot escape the consequences of their actions simply because they wear a badge.

Because so many of these shootings happen in urban areas, the elected prosecutors are often Democrats — which means that, thanks to a more liberal primary electorate, black voters can exert more pressure on candidates than they might be able to in a general election. The Black Lives Matter movement has made voters more conscious of these incidents than ever before.

Forcing out prosecutors who refuse to charge police with crimes for fatal shootings of unarmed black men may be the best sustainable strategy of changing that national culture of impunity, where police need only say they were afraid to justify ending someone’s life. If prosecutors know they will pay a price for letting cops slide, they will be less likely to do so.