Holliston resident James Arena-DeRosa defeated Hopkinton Town Clerk Connor Degan in Tuesday’s Democratic primary for state representative in the 8th Middlesex District, which includes Hopkinton, Holliston, Sherborn and part of Millis.
According to an Associated Press accounting of the race shortly before midnight Tuesday, with 99 percent of votes counted, Arena-DeRosa had 3,101 votes (57.4 percent) to Degan’s 2,304 votes (42.6 percent).
Arena-DeRosa will face Republican Loring Barnes of Millis in the Nov. 8 general election. Barnes was unopposed in the primary.
The seat has been vacant since Carolyn Dykema stepped down Feb. 11 to take a job with a solar energy company.
In other statewide races on the Democratic side, expected winners were: Maura Healey for governor, Kim Driscoll for lieutenant governor, Andrea Campbell for attorney general, William Galvin for secretary of state and Diana DiZoglio for state auditor.
There were two contested races on the Republican side, with Geoff Diehl earning the bid for governor and Leah Allen holding a slight lead over Kate Campanale for lieutenant governor with 75 percent of the votes counted.