Middlesex County District Attorney Marian Ryan has fended off a Democratic primary challenge.
With 98 percent of precincts reporting, the incumbent is ahead of challenger Donna Patalano 53 percent to 47 percent.
The Associated Press called the race late Tuesday night.
Ryan was elected DA of the state's most populous county in 2013.
Patalano is a former defense attorney and former prosecutor in the Suffolk County district attorney's office.
There are no Republicans on the ballot.
Correction: An earlier version of this story said Patalano is a current Suffolk prosecutor. We regret the error.
This article was originally published on September 05, 2018.