ANDREA CAMPBELL, who leaned into her personal story of overcoming adversity and that of family members caught in the criminal justice system who did not, sailed to a decisive victory over labor attorney Shannon Liss-Riordan in the Democratic primary for attorney general. 

Campbell, 40, who was raised by her grandparents and other family members in Roxbury, would be the first Black woman to hold statewide office if she prevails in the November election against Republican Jay McMahon. 

Campbell won 51 percent of the vote to Liss-Riordan’s 34 percent in the race to succeed two-term AG Maura Healey, who gave up the seat to run for governor. Liss-Riordan, who earned millions of dollars in fees from class-action lawsuits on behalf of lower-wage workers, poured more than $9 million into the race, drawing criticism that she was trying to buy the election. 

The attorney general’s race took center stage in the Democratic primary after the race for governor effectively ended in June, when Healey’s opponent, Sen. Sonia Chang-Diaz dropped out. Healey captured 85 percent of the vote to 15 percent for Chang-Diaz, who still appeared on the primary ballot. Healey will be heavily favored over Republican Geoff Diehl in November and, if successful, would become the first woman elected governor of Massachusetts and the first lesbian governor elected in the country. 

In other contested statewide Democratic primary races, Salem Mayor Kim Driscoll won a three-way battle for the lieutenant governor nomination. State Sen. Diana DiZoglio beat Chris Dempsey in the race to succeed state Auditor Suzanne Bump, who did not seek reelection. Secretary of State Bill Galvin crushed primary challenger Tanisha Sullivan as he seeks an eighth four-term. 

Campbell, who served three terms of the Boston city council before waging an unsuccessful campaign last year for mayor, started the attorney general’s race with a big polling lead and higher name recognition than Liss-Riordan and a third candidate, Quentin Palfrey, who dropped out a week ago and endorsed Campbell. She held on to win in the face of a massive spending barrage from Liss-Riordan, who unloaded $9.3 million of her own money into the race. 

Campbell sought to contrast her campaign, which she called “people powered and grass-roots,” with that of Liss-Riordan, who used her wealth to try to overcome her lack of name recognition. Campbell got support from two different super PACs, which together spent nearly $1 million promoting her candidacy.

Perhaps the biggest boost Campbell got was from Healey, who became her most prominent backer, staking lots of political capital on the heavily contested primary. 

Campbell was also endorsed by Sen. Ed Markey and Rep. Ayanna Pressley. 

Meanwhile, Liss-Riordan scored big endorsements from Sen. Elizabeth Warren and Boston Mayor Michelle Wu, turning the AG’s race into something of a proxy battle between some of the state’s leading progressive Democratic officials. 

Campbell graduated from Boston Latin School and went on to Princeton and UCLA law school. She spoke often on the campaign trail about her twin brother Andre, who died at age 29 while a pretrial detainee in Department of Correction custody, and how his plight inspired her to public service and the fight for criminal justice reform and greater opportunities for those struggling at society’s margins. 

Campbell and Liss-Riordan shared progressive views on many criminal justice issues and other issues facing the office, but they differed on others. While Liss-Riordan said she supported a move to allow communities to reinstate rent control and safe injection sites for IV drug users, Campbell took a more guarded view on those issues, saying she would not stand in the way of an effort to give communities those powers. Campbell has also long been a supporter of charter schools, which Liss-Riordan took aim at and charged with weakening district school systems. 

In the Democratic race for lieutenant governor, Driscoll, who has served as mayor of Salem since 2006, rode a wave of support built on strong ties she has developed to local officials across the state. She was also the beneficiary of an unusual level of interest in the lieutenant governor’s race, with an outside super PAC spending $1.2 million to support her. 

Driscoll outpaced her chief rival, state Sen. Eric Lesser of Longmeadow, who argued that his legislative background, federal experience in the Obama White House, and the geographic balance he would bring from Western Massachusetts made him a good running mate for Healey. Driscoll finished with 47 percent of the primary vote to Lesser’s 33 percent. State Rep. Tami Gouveia of Acton, who drew support from the party’s most progressive wing, finished third with 20 percent. 

In the auditor’s race, DiZoglio, who touted her willingness to take on legislative leaders on Beacon Hill and who enjoyed heavy backing from labor unions, defeated Dempsey, a former state transportation official, 54-46. She will face Republican Anthony Amore in the general election.

In the secretary of state’s race, Galvin showed his political staying power, fending off a challenge from Sullivan, a corporate lawyer and president of the Boston NAACP, by an even bigger margin than his primary victory four years ago against then-Boston City Councilor Josh Zakim. Galvin was on track to receive 70 percent of the vote to 30 percent for Sullivan, who, like Zakim, ran at him from the left, charging that Galvin was too slow to embrace voting reforms and other changes. Galvin will face Republican Rayla Campbell in November.