BOSTON (WWLP) – A victorious Sen. Diana DiZoglio auditor bid notwithstanding, Tuesday’s primary election was a bad day for Massachusetts lawmakers seeking statewide office and a good day for representatives and senators further down the ballot.

All but one incumbent member of the Legislature who faced competition secured their party’s nomination for another two-year term, most of whom face no additional declared opponent in November. Also, a majority of legislators seeking new elected positions also won their races, particularly further down the ballot.

Several lawmakers survived tough challenges by tight margins. In the race for the 18th Middlesex District in Lowell, Rep. Rady Mom earned just 68 more votes than runner-up Tara Hong, a margin of less than 3 percentage points among the 2,336 total votes cast in the contest, according to unofficial results provided by city officials.

Veteran Rep. Paul Donato of Medford was on track to win by a single percentage point or less. The Associated Press had not yet declared a winner in the race by noon Wednesday, but Donato told the News Service that his opponent, Malden activist Nichole Mossalam, called him Tuesday night to concede.

Donato, an 11-term Democrat, said his margin of victory was roughly 55 votes, reflecting a split of about 50.6 percent to 49.4 percent “or somewhere in that area.”

“I told my supporters last night that the district has changed. There are new people in it,” Donato said late Wednesday afternoon. “The district has changed, and I along with the people who lived in the community for a long time have to accept that change and we now have to start working in harmony with the new people and look at the changes they’re looking to be made and reflect on those changes.”

By midday Wednesday, the AP called the 16th Essex District race in favor of challenger Francisco Paulino, making Rep. Marcos Devers the only sitting state representative or senator to lose a primary this cycle.

Paulino led with 53 percent of the vote to 47 percent for Devers with more than 95 percent of votes reported, according to AP data published by The New York Times.

A Devers legislative aide said the five-term representative, who lost a primary in 2016 before winning a return bid two years later, “does not have a comment at this time.”

Incumbent lawmakers running for a new position went seven for 12 on Tuesday.

Four representatives earned a spot on the November general election ballot to join the Senate: Democrats Liz Miranda of Roxbury, Paul Mark of Peru and Jake Oliveira of Ludlow, plus Republican Shawn Dooley of Norfolk.

Miranda topped a five-way primary for the open and reshaped Second Suffolk District in the Senate, beating out fellow Rep. Nika Elugardo — one of the five lawmakers who unsuccessfully sought a higher office this cycle — and former Sen. Dianne Wilkerson in the process.

With more than 95 percent of votes reported, the AP tally showed Miranda with 33 percent of the vote, followed by Elugardo with 27 percent.

During her election night party, Miranda said she would bring “fresh ideas and fresh eyes” to the Senate, according to the Dorchester Reporter.

“They say I’m too flashy, too social, but this is your next Second Suffolk senator,” the Dorchester Reporter quoted Miranda as saying. “There were times when I wanted to give up, a lot of times when I went to college, and I’d come back home crying and say, ‘I can’t do this.’ My mom would say, ‘Get back on that bus and you’re not only going to do this, but you’re going to finish at the top.’ And I did. That encouragement and love is what all the kids in the Second Suffolk deserve.”

Mark, a six-term representative, cruised to victory in the Democratic primary for the westernmost Senate district with about 85 percent of the vote, while Oliveira easily topped a Democratic primary for a Senate district representing parts of Hampden, Hampshire and Worcester counties.

Oliveira, who is still in his first term in the House, will now run against Republican William Johnson of Granby in the general election. Mark does not have an opponent in November.

Their wins, plus the open race for the region’s Governor’s Council district, continue a trend of rapidly evolving representation for the state’s western stretches.

Regardless of who wins in the Oliveira-Johnson showdown, two of the roughly half-dozen Senate districts west of Worcester will have new lawmakers in January. Another one is held by Springfield Sen. Adam Gomez, who two years ago toppled incumbent Sen. James Welch in a primary contest. Two others feature senators — Jo Comerford of Northampton and John Velis of Westfield — currently in their second terms.

On top of the Senate turnover, the shuffle means the House districts represented today by Mark and Oliveira will also welcome fresh faces for the 2022-2023 session.

Dooley, the only other representative who ran for Senate, did not have a Republican challenger Tuesday and will face off against Democrat Sen. Becca Rausch in November.

A Republican state rep and a Democrat state rep both prevailed Tuesday in races for law enforcement offices.

Rep. Paul Tucker, a Salem Democrat, topped attorney James O’Shea of Middleton in the primary for Essex County District Attorney, while Rep. Tim Whelan of Barnstable did not face a Republican opponent in the primary for Barnstable County sheriff.

Higher up the ballot, representatives and senators running for new offices mostly struggled. Sen. Diana DiZoglio of Methuen won the Democratic primary for auditor, making her the only lawmaker to find success in a statewide race Tuesday.

Acton Rep. Tami Gouveia and Longmeadow Sen. Eric Lesser both fell short in the lieutenant governor race — where Pittsfield Sen. Adam Hinds failed to make the ballot at the nominating convention — and Boston Sen. Sonia Chang-Díaz stopped campaigning for governor months ago.

In other offices beyond the Legislature, Governor’s Councilor Marilyn Devaney emerged victorious in a close reelection bid despite narrowly losing her hometown of Watertown.

Mara Dolan, a public defender and former political aide who challenged Devaney in the Democratic primary, tweeted her concession just before 1:30 p.m. Wednesday.

“What a great race! We flipped at least 13 towns, even Watertown,” Dolan tweeted. “Only 1,400 votes out of over 98,000 made the difference. I have called to concede to the incumbent. This race was a joy and a labor of love. I’m not stopping.”

Dolan and Devaney have been embroiled in a heated race, trading accusations of smear campaigns.

Meanwhile, in the only other Governor’s Council district with a contested primary, the winner made a point to call for bringing “a level of civility and decorum and stability” to a panel whose hearings often feature personal feuds, bizarre accusations and tense proceedings.

North Adams School Committee Member Tara Jacobs, who told the News Service the three other Democrats in the primary for the Council’s Eighth District called her to concede, said she hopes it can become “a more pleasant place for nominees to be vetted.”

“The Governor’s Council being a painful experience limits our field of nominees who don’t want to subject themselves, and I think that is not to the benefit of our state,” Jacobs said.

Jacobs led with 33 percent of the vote in the latest tally, followed by Michael Fenton of Springfield with 30 percent. She attributed her success to several factors, including her status as the only woman in the race and the only candidate who was not a lawyer — a unique trait for a job on a panel that vets and confirms judicial nominees.

“I think the fact that I’m not an attorney actually really resonated with people,” Jacobs said. “There are so many attorneys involved, especially from a judicial standpoint. The nomination process is infused with so many voices from the legal community that the people deserve a voice too, and I think that really resonated.”

She will face John Comerford of Palmer, the lone Republican candidate, in November. Both are vying to succeed retiring Councilor Mary Hurley of Springfield.