During a debate this summer at the Suffolk County House of Corrections, District Attorney candidate Rachael Rollins told the audience of incarcerated women and men that members of her own family were struggling with opioid addiction. She said this was among the reasons she supported treating, rather than arresting, addicts. Many in the audience nodded in agreement. At that same debate, during a discussion on criminal reform, Rollins said she wanted to end the practice of cash bail for cases of low-level, nonviolent offenses, saying it discriminated against the poor.

It was one of several issues she said differentiated her from her chief competitor, Greg Henning. In a field of four other Democratic candidates, many saw the race as mainly a contest between Henning, a candidate endorsed by outgoing DA Dan Conley, and Rollins, the Boston Globe’s choice.

Rollins, a former state and federal prosecutor, surprised many pundits Tuesday night by her margin of victory.

She has compared her views on criminal justice with those of Larry Krasner, a progressive district attorney in Philadelphia, who has upended traditional ways of doing things in the city of brotherly love. Many of Rollins' supporters expect the same from her if she’s elected in November as the chief law enforcer for the state’s biggest county, representing Boston, Chelsea and Revere.

Rollins, a member of Attorney General Maura Healey’s Advisory Council on Racial Justice and Equity, says if she wins the DA’s post outright in the midterm election, she plans to make big changes in the way that justice is meted out in Suffolk County.

“I believe that the office does not adequately reflect the rich diversity of Suffolk County,” she said. “Dan Conley had the job for 16 years and there's virtually little diversity within that office. Over 87 percent of the DA's are white. And we know that over 70 percent of the people that are stopped and followed by the Boston police are black.

Like recent DA races in Philadelphia and Ferguson, Missouri, the Suffolk DA primary came amid national reports of questionable police shootings of black men and women and the failure of DA’s in many jurisdictions to prosecute. The Suffolk race reflected heightened concerns over what some call the new Jim Crow: mass incarceration.

“I believe there needs to be some autonomy between the group that investigates officer involved shootings and the DA's office,” Rollins told WGBH. “Right now, the DA's, the assistant district attorneys, investigate those shootings themselves. I want to propose that there is a separate group of people that I will select; former prosecutors, criminal defense attorneys, retired judges, retired law enforcement. There will be women, there will be people of color in those groups. They're going to investigate those officer-involved shootings and report directly to me.”

Rollins became the first African-American woman to win a Democratic primary for the position of Suffolk DA. She says she will reach out to Greg Henning and the three other former Democratic candidates — Evandro Carvalho, Shannon McAuliffe and Linda Champion — for their support.

“It’s my duty to go out and make sure I'm speaking to the people that supported the other candidates because we need to be successful in November, and we need to start collaborating with people that might have been on a different team, because we now all have to move forward together.”

Before running for DA, she served as general counsel for the MBTA for two years, and for Massport from 2013 to 2015. Rollins also worked in the civil division of the US Attorney’s office.

In November, Rollins will face business owner and Brockton lawyer, Michael Maloney, a charismatic independent candidate who lacks a campaign staff and whose focus is almost entirely on reducing sentencing for using and selling illegal drugs. Some local pundits say it could be a tough race, though they believe Rollins, the Democrat, will likely be the new Suffolk County district attorney.