African-American lawyers, racial justice groups and the liberal hedge fund billionaire George Soros are combining forces to try to elect more black prosecutors in response to what they see as an insufficient response by incumbent district attorneys to the killings of black people by the police.

The effort faces steep demographic and institutional obstacles that have kept the offices of elected prosecutors — those deciding whether to seek criminal charges against the officers responsible — among the whitest reserves in U.S. politics.

Only a few dozen out of more than 2,300 elected prosecutors nationwide are African-American, according to two recent studies by liberal groups. Even the National Black Prosecutors Association, which has 400 members, can point to only about a dozen who were elected to their posts.

But that number has begun to grow, with activists and lawyers recruiting black candidates while outside groups — largely financed by Soros, who is as revered on the left as he is reviled on the right — hire political consultants to produce slick campaign ads.

Together, the candidates and their allies are often overwhelming white candidates — some of whom have complained that they were targeted merely because of their race.

Since last year, the effort has produced two black district attorneys in rural Mississippi and one in Caddo Parish, Louisiana — known as the nation’s leading jurisdiction for death sentences. And Tuesday, four black candidates are expected to cruise to election as the top local prosecutors in Chicago; St. Louis; Orlando, Florida; and suburban Henry County, Georgia.

“In many ways, it is just as important as the governor’s race or the presidential race,” said Benjamin L. Crump, a Tallahassee, Florida, lawyer involved in the push, who has represented families of the victims in some of the most highly publicized killings of African-Americans in recent years, beginning with the shooting of Trayvon Martin by George Zimmerman in 2012.

“It may have a more profound effect on your life than any national office will have, because this is going to determine whether your children get trumped-up charges and have the words ‘felony conviction’ on their backs for the rest of their lives,” Crump said, “or, even worse, if they are going to be killed in cold blood and broad daylight, and no one will be held accountable for it.”

Aramis Ayala, who defeated a Democratic incumbent in the primary for Florida state attorney for Orange and Osceola counties, was a television analyst during the trial in which Zimmerman was acquitted. And Kim Foxx was advised by Crump in her successful primary challenge to Anita Alvarez, the incumbent state’s attorney in Cook County, Illinois, who was criticized for her handling of the 2014 fatal police shooting of Laquan McDonald, a black 17-year-old.

Crump has also worked with the family of Michael Brown, whose fatal shooting by a white police officer in 2014 set off days of unrest in Ferguson, Missouri. Crump said the white prosecutor’s failure to obtain an indictment there led him to believe that black people were being “stripped of their fundamental humanity,” and to seek a new strategy to curb police violence: electing more black district attorneys.

Finding candidates, however, requires overcoming obstacles. These include a long-standing perception that legal careers in defense and civil rights work were more laudable, said Rashad Robinson, executive director of Color of Change, a racial justice group whose political action committee has aided the effort. “The role of chief law enforcer for a community is not always the first role many people think of that are reform-minded,” he said.

While cities elect mayors, elected prosecutors typically represent counties, often including majority-white suburbs, “which may have different ideas about what makes sense for criminal justice and law enforcement and safety,” Robinson said. District attorney posts also do not have natural steppingstones, the way novice politicians can gain experience running for alderman or a seat on the school board. And first-time candidates often must challenge entrenched incumbents who are also their bosses.

Ayala, who is unopposed in November and is set to become the first black elected prosecutor in Florida history, started out as a prosecutor but became a public defender because she believed too many defendants were receiving inadequate counsel. She returned to the state attorney’s office in 2014 out of frustration with the Zimmerman case. The defense had done everything it could to portray Martin as a thug, she said, adding that if the prosecution had included an African-American, it might have portrayed him as more sympathetic.

She said she hoped to address strained relations between many black people and police. “I want to work to fix that,” she said. “While they may not have the shootings, there are a lot of reports and allegations of excessive force.”

What clobbered the man Ayala unseated, Jeffrey L. Ashton, was $1.4 million from the Florida version of the Safety and Justice political action committees Soros has bankrolled in one state after another since last year.

“It was like she had a megaphone and I was whispering,” Ashton said ruefully in an interview. He argued that he and Ayala barely differed on policy, and bluntly called himself a victim of “racism.”

“The only thing that differentiated my opponent and I was that I’m a white male and she’s a black female,” he said. “You’re basically saying, ‘Well, I have a lot of money and I want a black face in this office, so here’s $1.4 million.’ I just think that’s scary.”

Similarly, more than $700,000 from Illinois Safety and Justice helped carry Foxx to a primary victory over Alvarez, a two-term incumbent who was denounced for her handling of the McDonald case, in which a video of the teenager being shot 16 times by police officers was not made public for more than a year.

Foxx represented foster children as a young lawyer but saw how prosecutors had the power to remove children from their homes, and decided to become one herself. “All of that discretion lies with the prosecutor,” she said. “If we only have diversity in responding to that, it’s too late.”

Far from promising to keep race out of their decision-making, the new black prosecutors and candidates — like Kimberly Gardner, who won a four-way primary for circuit attorney in St. Louis and is unopposed Tuesday — are explicitly promising to address issues like disparate incarceration rates and police misconduct.

And they are drawing on personal experience for lessons on how to be tough on crime without being needlessly harsh.

Ayala, in Florida, said her husband had once been caught up in the juvenile justice system and later served seven years in prison on drug charges. He now works for a nonprofit. “You have to distinguish between a child who is misguided and frustrated from home issues and a child who is dangerous,” she said.

The thin ranks of black elected prosecutors do include some high-profile figures. Since the Ferguson protests, R. Seth Williams, the Philadelphia district attorney, has held informal talks with a small group of African-American peers on the best ways to respond to police killings. And it was Marilyn Mosby, the state’s attorney for Baltimore, who led the investigation into the case of Freddie Gray, a 25-year-old black man who died after riding unsecured in a police transport wagon.

Six officers were charged with crimes; the first trial ended in a hung jury, and three officers were acquitted. Mosby dropped the remaining charges.

But she is unapologetic. Had the case been handled differently, “there would have been no accountability,” she said in an interview. “You have to have a seat at the table, and you have to be the change you want to see.”

A small group of advocates are leading the charge. The National Bar Association has urged black line prosecutors to run for office; the National Black Prosecutors Association is offering to mentor candidates; and Soros, through Color of Change and his growing network of Safety and Justice PACs, has funneled nearly $5 million into the cause since last year.

Not all the campaigns have ended so well for Soros: Robert Shuler Smith, a black district attorney whom he helped win re-election in Hinds County, Mississippi, has since been indicted on charges of conspiring to aid a criminal defendant.

And in Houston, Soros’ first choice, Morris Overstreet — a former judge who was the first African-American elected to a statewide office in Texas since Reconstruction — was defeated in the Democratic primary by a white woman, Kim Ogg. Soros has now spent $500,000 to aid her against the Republican incumbent, Devon Anderson.

Soros, who declined to be interviewed, has also supported Hispanics seeking prosecutors’ posts in Arizona and New Mexico, a spokesman said.

“Race does not explicitly play a role, but in seeking candidates who understand the injustices of the current system, many of them turn out to be African-American or Latino, because it is people of color who have been disproportionately affected by those injustices,” the spokesman, Michael Vachon, said in an email.

Crump said he wants to focus attention next on elected prosecutors in Staten Island, New York; Minneapolis; and Baton Rouge, Louisiana, places that have each seen high-profile killings of black men.

But first, Brooklyn voters next year will elect a successor to Ken Thompson, the New York borough’s first black district attorney, who died of cancer last month before finishing his first term.

In what was apparently his last interview, Thompson made clear that electing black prosecutors would not just mean charging police officers who might not have been charged before or declining to seek prison time for blacks who might have been dealt with more harshly in the past.

He pointed to his decisions to stop prosecuting most low-level marijuana cases, create a program aimed at helping people clear warrants for low-level offenses, and devote resources to reversing wrongful convictions. Electing more black district attorneys, he said, might give blacks and the poor a fairer shake.

“We should first determine if those who enter the criminal justice system belong in the criminal justice system — not just sort of process them on,” he said.

“There are a lot of lock-'em-up, keep-'em-moving DAs,” he added. “I’m not one of those guys.”