BOSTON — Two incumbent Democratic Massachusetts lawmakers will not be returning to Beacon Hill after losing their primary races, and Thursday’s voting also set the stage for several other contests in November.

Voter interest in the primary was dampened by the absence of any statewide races on this year’s ballot. The state’s presidential primaries were March 1. Election officials had said they doubted more than 1 in 10 voters would venture to the polls, though turnout was expected to be higher for some spirited local races.

State Rep. Marcos Devers finished behind Juana Matias, a lawyer and advocate on immigration issues, in a three-way Democratic primary in Lawrence. Devers had represented the city since 2010.

Four-term Democratic Rep. Timothy Toomey was ousted by Mike Connolly, a lawyer and community activist, in the primary in parts of Cambridge and Somerville.

In the race to succeed state Sen. Brian Joyce, who did not seek re-election amid a federal investigation, state Rep. Walter Timilty, of Milton, won the Democratic primary over Nora Harrington. Timilty will face an independent candidate, Jon Lott, in November.

Voters also decided primaries in two state Senate districts on opposite sides of the state where incumbents were not seeking re-election.

Adam Hinds, head of the Northern Berkshire Community Coalition, bested two other Democratic candidates and will square off against Republican Christine Canning in November for the seat now held by Democrat Benjamin Downing.

Democrat Julian Cyr, a former state public health official from Truro, and Republican Anthony Schiavi, a retired U.S. Air Force brigadier general from Harwich, won their respective primaries and will meet in November for the seat now held by Democratic Sen. Dan Wolf.

Thursday’s lone contested congressional primary in Massachusetts was in the 9th District, where Mark Alliegro, a scientist from Falmouth, defeated fellow Republican Thomas O’Malley of Marshfield. Alliegro will face incumbent Democratic Rep. William Keating in November. Only three other members of the state’s all-Democratic U.S. House delegation, Joe Kennedy, Niki Tsongas and Katherine Clark, have Republican opponents this fall.

In an unusual development, Joan Meschino, a Democrat from Hull, was declared the winner in both a state Senate primary and a state House primary.

Meschino was on the ballot for the Senate seat then launched a write-in campaign for the House seat held by Democratic Rep. Garrett Bradley when he made a late decision not to seek re-election.

Meschino is expected to decline the nomination to run against incumbent Republican state Sen. Patrick O’Connor and continue her pursuit of the House seat. If so, the Democratic party could choose another candidate to challenge O’Connor in November.

In Springfield, meanwhile, a House seat will not be remaining in the family as Benjamin Swan Jr. finished second behind City Councilor Bud Williams in a four-way Democratic primary race to succeed Swan’s father, longtime Democratic Rep. Benjamin Swan Sr., who is retiring.