Veteran Alabama law enforcement officer Mark Pettway grew up in a black neighborhood called “Dynamite Hill” because the Ku Klux Klan bombed so many houses there in the 1950s and ’60s.

Now, after becoming the first black person elected sheriff in Birmingham - on the same day voters elected the community’s first black district attorney - Pettway sees himself as part of a new wave of officers and court officials tasked with enforcing laws and rebuilding community trust fractured by police shootings, mass incarceration, and uneven enforcement that critics call racist.

In a state where conservative politicians typically preach about getting tough on crime, Jefferson County’s new sheriff ran and won on an alternative message. He favors decriminalizing marijuana, opposes arming school employees, supports additional jailhouse education programs to reduce recidivism and plans for deputies to go out and talk to people more often, rather than just patrolling.

“Going forward we need to think about being smarter and not being harder,” said the Democrat Pettway, 54.

While the nation’s law enforcement officers are still mostly white men, and groups including the American Civil Liberties Union and Black Lives Matter call for sweeping changes in the criminal justice system, minorities appear to be making gains nationwide.

In Pettway’s case, strong turnout by African-American voters, combined with national concern over police shootings of unarmed people of color, helped him defeat longtime Sheriff Mike Hale, a white Republican, said professor Angela K. Lewis, interim chair of political science at the University of Alabama at Birmingham. Winners in other cities attributed their success to similar factors.

Houston voters elected 17 black women as judges in the midterms. Even before the election, nearly the entire criminal justice system in the Georgia city of South Fulton, near Atlanta was run by black women, including the chief judge, prosecutor, chief clerk and public defender. They’re offering more chances for criminal defendants to avoid convictions through pre-trial programs and increased use of taxpayer-funded lawyers to protect the rights of the accused.

Chief Judge Tiffany C. Sellers of South Fulton’s municipal court said officials also explain court procedures in detail to defendants, many of whom haven’t been in court before and are scared.