Image copyright Getty Images

While most of the focus of Tuesday night's primaries was on the battle for the White House, something extraordinary occurred in two local elections. Both Chicago's Cook County State's Attorney Anita Alvarez and Timothy McGinty, the Cuyahoga Prosecuting Attorney in Ohio, lost their bids for re-election.

In Alvarez's case, it was a blow-out - she lost to her opponent almost 2-1.

As the so-called "top cops" in their respective jurisdictions, Alvarez and McGinty made key prosecutorial decisions in the controversial killings of unarmed African Americans by police officers. For Alvarez, it was the death of Laquan McDonald, shot 16 times by former officer Jason Van Dyke in 2014. In Cleveland, McGinty recommended that a grand jury not charge the officers who shot and killed 12-year-old Tamir Rice in a public park.

These are not the first prosecutors who recently failed to secure another term on name recognition and a "tough on crime" platform as the need for criminal justice reform gathers steam across the country. But they are the first ones to have faced off directly against the Black Lives Matter movement and lost.

"Black youth kicked Anita Alvarez out of office," the Chicago activist group Assata's Daughters wrote in a triumphant statement last night. "Just a month ago, Anita Alvarez was winning in the polls. Communities who refuse to be killed and jailed and abused without any chance at justice refused to allow that to happen.

Image copyright Getty Images

"We did this for Laquan."

According to the widely disseminated original account of the shooting of Laquan McDonald, the teenager had lunged at officers with a knife when he was shot. But dash camera footage of the incident - which was obtained by local journalists - showed he was moving away from police when Van Dyke opened fire, striking the 17 year old multiple times as he lay on the ground.

Though Alvarez ultimately charged Van Dyke with first-degree murder, she did it more than a year later, just before the camera footage was to be made public by a judge's order. The timing gave the distinct impression that a cover-up had barely been averted, and that Alvarez was more interested in protecting the jobs of officers than she was in justice.

Alvarez ignored calls for her resignation and always maintained that she waited more than 400 days because she believed that a federal investigation needed to be completed before charges were brought against Van Dyke.

"I don't believe any mistakes were made," she insisted during the campaign.

A coalition of activists - members of Black Youth Project 100, Assata's Daughters and Black Lives Matter Chicago - did not endorse Alvarez's challenger, Kim Foxx. Instead they joined forces to oppose Alvarez.

Their protest and canvassing efforts culminated in the hashtag campaign #ByeAnita, words which could be seen fluttering on a huge banner trailing behind an airplane flying over downtown Chicago on election day. Alvarez started the day with a lead in the polls, but without key endorsements from former allies and the local media.

In the Rice case, McGinty encouraged a grand jury not to charge the two officers who opened fire on Rice after less than two seconds on the scene. After they obliged, McGinty said evidence showed it was indisputable that Rice was reaching to pull out his pellet gun when he was shot, despite differing expert testimony.

Image copyright Getty Images Image caption Tim McGinty

This was seen as a knee-jerk response to protect police, and Black Lives Matter Cleveland showed up with members of Rice's family to picket McGinty's home during the campaign. As Cleveland Scene editor in chief Vince Grzegorek sees it, nothing but public outrage can explain McGinty's fall.

"It's hard not to see the vote as anything but a referendum on McGinty's handling of Tamir Rice and other police use-of-force cases," he wrote in an email to BBC News.

The Black Lives Matter movement has been criticised for its lack of focus, aversion to a hierarchical structure, and inability to translate rage from street protests into tangible political goals. They have not coalesced behind a presidential candidate, and have disrupted both Democrats Bernie Sanders and Hillary Clinton at campaign events.

Aislinn Pulley, cofounder of Black Lives Matter Chicago, declined a recent invitation to the White House, deriding it as a "photo opportunity". For those reasons, the movement has often been dismissed as an aimless and empty social media campaign.

Image copyright Getty Images Image caption Black Lives Matter protesters in Chicago tried to shut down holiday shopping to draw attention to the Laquan McDonald case

But last night's results answered those criticisms with definitive proof of the movement's real political clout. The fact that the focus has shifted from police officers to prosecutors is significant, and these races prove that activists' message resonates with voters. Prosecutors and politicians are now on alert - ignore their concerns at your own professional peril.

"For an evolving movement - youth-driven - to discover that it has this sort of electoral power, I can't predict what will flow from that," says Jamie Kalven, founder of the Invisible Institute, a non-profit journalism outfit on the south side of Chicago. "It's really something."

Where this newly discovered political might goes next remains to be seen. Chicago Mayor Rahm Emanuel, who like Alvarez denied that he was slow to act or that he was part of a cover-up, has already survived a re-election campaign - one that took place before the tape's release and just days before the city settled a civil lawsuit brought by McDonald's family. He's been called "political poison" by the Chicago Tribune - Sanders tried to hurt Clinton in the Illinois primary by pointing out her ties to Emanuel.

Image copyright Getty Images Image caption Last year people protested outside of McGinty's house in response to another officer being acquitted of manslaughter

"I'm quite sure he would concede the point that if he were on the ballot yesterday he would have been voted out emphatically," says Kalven.

The morning after the primaries, another prosecutor - this one in Minneapolis, Minnesota - announced that he would not use a grand jury in order to decide whether to charge two officers in the shooting death of Jamar Clark in late 2015. Local Black Lives Matter activists celebrated the decision as a victory for transparency, proving once again that the movement now has prosecutors' attention.

The new generation of prosecutors will not have a moment to rest easy. Michael O'Malley, McGinty's successor, has demurred when asked how he would have handled the Rice case differently. Likewise, a vote for Foxx was really a vote against Alvarez, as Assata's Daughters pointed out in their statement.

"We won't stop until we're free and Kim Foxx should know that as well," they wrote.