The results suggest that most progressives who voted for Bell also sided with the unions in solidarity. The unions, meanwhile, voted for their own interests on the right-to-work law, but voted against the criminal justice reform movement.

Bell was elected St. Louis County prosecutor with 57 percent to McCulloch’s 43 percent of the vote. The statewide measure on union rights, known as Proposition A, was meanwhile opposed by 73 percent of voters, with about two-thirds of the overall votes being cast in St. Louis County.

While the unions were giving money to McCulloch, they were also working to turn out the vote in an effort to beat back a “right-to-work” law that would have crippled unions in the state. Voters on Tuesday voted down the law by a landslide — a victory for workers — but the increased union turnout likely also made the prosecutor’s race closer than it otherwise would have been, though it’s impossible to know for sure without exit polling.

Bell’s effort had the support of a slew of local activist organizations, as well as national ones such as Real Justice PAC (which is affiliated with The Intercept columnist Shaun King), Color of Change, and the American Civil Liberties Union.

McCulloch was widely criticized for his apparently purposeful inability to get an indictment against Darren Wilson, the Ferguson police officer who fatally shot Mike Brown four years ago to the day. He never indicted a police officer for killing an unarmed civilian throughout his 27-year tenure. Bell, meanwhile, vowed a different approach. He told the New York Times that he will appoint an independent special prosecutor to police shooting cases, and that he will make prosecutor’s office data available to the public to ensure transparency and facilitate discussion addressing racial disparities. He also pledged to end cash bail, to stop prosecuting low-level marijuana offenses, and to work toward rolling back mass incarceration.

One of the only places where the pattern doesn’t hold is in the U.S. Senate race in California, where labor is backing Kevin de León over incumbent Sen. Dianne Feinstein. That support has more to do with de León’s record in the state Senate than it does with him being the insurgent in that race. As the Senate leader, he was an establishment figure, albeit a progressive one, and one that delivered for labor.

The unions’ support for McCulloch is part of an emerging pattern. As a new Democratic insurgency has risen over the last year, unions have clung tightly to the old guard. In New York, they sided with Rep. Joe Crowley over Alexandria Ocasio-Cortez, and with Gov. Andrew Cuomo over Cynthia Nixon, even walking out of the Working Families Party on his orders. (In Missouri, the WFP supported Bell.) And the union backing is not limited to incumbents. Unions were firmly behind Gretchen Whitmer, who defeated Abdul El-Sayed in Michigan’s gubernatorial primary, for instance, and with Brad Ashford , a conservative Democrat who lost to insurgent Kara Eastman in an Omaha, Nebraska, congressional primary.

It’s common for police unions to support prosecutors, but the labor groups who backed McCulloch came from the trade union movement: steamfitters, carpenters, electrical workers, and others with no obvious connection to the criminal justice system. Their support came in the form of both endorsements and campaign funds. The unions pumped in at least $25,000 of the $237,000 McCulloch raised during the campaign, arguing that his longtime support of organized labor deserved loyalty.

St. Louis County , Missouri, labor unions spent heavily in an effort to re-elect prosecutor Bob McCulloch, who was ousted on Tuesday by criminal justice reformer Wesley Bell, campaign finance reports reveal.

Michael Brown Sr., family, friends and Ferguson activists rebuild makeshift memorial on the site where Mike Brown Jr. was fatally shot by a Ferguson police officer in 2014. Tomorrow is the fourth anniversary of the shooting. pic.twitter.com/I10HlKSmcD

The Bell campaign went a step beyond just voting in solidarity. Kayla Reed, a lead organizer in the St. Louis area, said that as canvassers for Bell knocked on doors, they distributed literature urging a “no” vote on Proposition A.

Reed, who got her start in activism in the aftermath of the Brown killing in Ferguson, said she wasn’t surprised that the trade unions all lined up with McCulloch. The union protesters on the side of the burgeoning Black Lives Matter movement, she explained, were typically young and affiliated with “Fight for $15,” a campaign affiliated with the Service Employees International Union pushing for a higher minimum wage. But trade unionists, she said, often stood with the counterprotesters.

“The main voices opposing us were white union members,” she said, noting an “ironic bedfellow situation with the black community and unions. Black people are not in leadership in those unions.”

Reed said the trade unions aligned politically and ideologically with McCulloch’s prosecutorial zeal toward black defendants and his alliance with police forces, which helped make the St. Louis area heavily segregated. “They know Bob McCulloch, trust his law-and-order rhetoric, and believe that he’s going to keep people away from their areas,” she said.

The unions said their support of McCulloch came about because he has long been an ally of organized labor, and he allied with other Democratic politicians who have also been supportive of workers. The Sprinkler Fitters Local 268, for instance, kicked $1,000 to McCulloch’s campaign. Mike Mahler, the local union’s president, said their positioning in the race came down to organized labor’s general practice of supporting “friendly incumbents” rather than working to oust them.

“Bob McCulloch has stood with labor. Now, obviously, we don’t necessarily intersect in a lot of places. His job is to prosecute the bad guys, put ’em in jail,” he said. “But from his early days, when he ran, he also teamed up with some other labor candidates and they worked together, so that’s how we first connected.”

He said McCulloch would reliably show up to labor functions, rallies, or campaign stops for union-backed politicians or events. “He was in our camp,” Mahler said. “The tie-breaker, the nod, has always been to go with the friendly incumbent. We can’t dump a guy because somebody else has shinier shoes or whatever you want to call it. That doesn’t mean we were against the new guy.”

Asked if he thought McCulloch ran his office in a racist way, Mahler said he did not. “You have a job to do, you have to ask hard questions. Bob McCulloch has a job, he has to prosecute the bad guys. It’s not his job to write the law, it’s his job to enforce the law,” he said. “The next guy’s going to find out that it’s nice to have all these idealistic ideas, sometimes it’s not easy to accomplish. I think Bob was a very fair person.”

Mahler said the system is stacked against all poor people, not just black people. “Can you say that the system is stacked against poor people who can’t get good lawyers or post bond? Absolutely,” he said. (Class undeniably plays a role, but racial disparities have historically been a feature of policing in St. Louis County, as described in a damning report by the civil rights division of the Department of Justice. According to the ACLU of Missouri, black people make up only 24 percent of the county’s population, yet they comprise 67 percent of the jail population.)

LIUNA Local 110 gave McCulloch $1,750 toward his re-election. LIUNA’s Don Willey largely echoed Mahler, saying McCulloch had always been supportive of organized labor and had deep ties with the Democratic Party, which merited support. He said he looked forward to supporting Bell. “Better him than a Republican,” Willey said.

The black community’s relationship with unions is complicated, Reed said, because there is a broad understanding that unions are generally good for working people and specifically protect black workers who are part of their union. “They’ve always perpetuated racial inequality within their ranks, but also provided enormous amounts of protections for black colleagues within their ranks,” she said.

SEIU Missouri State Council, the political arm of SEIU Missouri, was one of the only labor unions that backed Bell.

“Our members are largely African-American workers, janitors, home care workers, nursing home workers, hospital workers in St. Louis and Kansas City,” said SEIU Missouri State Council Secretary Treasurer Lenny Jones.

“Our members have a very deep understanding of the link between racial justice and economic justice and really believe that the Wesley Bell election helped move our racial justice program forward, and our members were very disappointed with the work that Bob McCulloch did around the investigation of Michael Brown’s death. And saw this as a great opportunity to help elect a candidate, Wesley Bell, who’s really stepped up and been a leader in the Ferguson community over the last three years. So it was an easy choice for us.”

Trade unions generally, and in St. Louis County specifically, have historically been organized around ethnic lines that go beyond just white and black. The area’s carpenters and electricians, for instance, tended to be German-American, pipefitters and plumbers Irish-American, and laborers African American. Membership in trade unions, which are exclusive and not open to all workers, is highly coveted. In other words, it helps to know somebody.

According to McCulloch’s disclosures, his campaign got money from Missouri AFL-CIO; Iron Workers Local 396; Heat and Frost Insulators and Allied Workers Local No. 1; LIUNA Local 110; International Union of Elevator Constructors; Branch 343 of the National Association of Letter Carriers; Glaziers Architectural Metal & Glassworkers Local Union; Teamsters Local Union 600; UAW Region 5; several different firefighters unions; Plumbers and Pipefitters Local 562; Sprinkler Fitters Local 268; Steamfitters Local 439; and Gasworkers Local 506, among others.

Josi Nielsen, Bell’s campaign manager, said she was surprised the campaign wound up getting any union backing at all. The Missouri SEIU endorsement was “the only union endorsement of note we received,” she said.

She added that transit union workers, who are predominately black, appeared to side heavily with Bell, but the union itself did not endorse him.

Reed said she understands why unions are doubling in on themselves in a time when they’re under tremendous assault by the Trump administration, but that they should recognize that the new grassroots energy could be an ally in that fight. “They’re not recognizing the force of grassroots power and what that could do for their workers,” she said. “It’s almost like a self-inflicted wound they’re giving themselves.”

Correction: August 9, 2018, 1:35 p.m.

A previous version of this story misspelled the last name of Josi Nielsen, Wesley Bell’s campaign manager. It has been updated.