Joan B. Lovely won the Democratic nomination for Senate in the Second Essex District in a landslide, winning four out of the five communities and taking half of the total votes.
She will be vying with Richard A. Jolitz (R-Beverly) for the seat left open this year by Peabody Democrat Frederick E. Berry, who is retiring after nearly three decades on Beacon Hill.
Lovely, the president of the Salem City Council, was victorious in Salem (70 percent), Danvers (56 percent), Beverly (54 percent), and Topsfield (43 percent).
John P. Slattery of Peabody - an attorney and former state representative - won Peabody and finished with 30 percent of the total vote.
Democratic primary unofficial results:
Joan B. Lovely, Salem, 7,450 votes (50 percent)
John P. Slattery, Peabody, 4,418 votes (30 percent)
Mary-Ellen Manning, Peabody, 2,610 (17 percent)
Edward J. Carroll, Salem, 309 votes (2 percent)