BOSTON (AP) — One of only a handful of seats in the Massachusetts Senate held by Republicans is staying in GOP hands — at least for now.

Two seats in the Senate and one in the House were up for grabs in the special election Tuesday to replace outgoing legislators. The three seats will be up for election again in November.

In a South Shore district, Republican Patrick O'Connor defeated Democrat Joan Meschino. O'Connor succeeds Republican Robert Hedlund, who is now Weymouth's mayor.

O'Connor's win means Republicans will continue to hold six seats in the 40-member Senate.

O'Connor is president of the Weymouth Town Council and served as Hedlund's legislative director. He received about 1,000 votes more than Meschino, an attorney and former Hull selectwoman, according to unofficial results.

Republican Gov. Charlie Baker said O'Connor's victory shows voters are looking for efficiency and accountability in state government.

"I'm looking forward to working with Patrick to advance our shared agenda of lower taxes, expanded educational opportunity, and safe, thriving communities across the South Shore and Massachusetts," Baker said in a statement.

But O'Connor and Meschino could be headed for another showdown in November, when voter turnout will be high for the presidential election. State Sen. Thomas McGee, chairman of the Massachusetts Democratic Party, said he anticipated that Meschino would be on the ballot in the fall.

The race to succeed East Boston Democrat Anthony Petruccelli, who left the Senate to join a lobbying firm, was essentially decided last month when Joseph Boncore of Winthrop won a crowded Democratic primary. His path to victory in Tuesday's special election was clear with no Republican on the ballot.

On the North Shore, Democrat Daniel Cahill, of Lynn, won the special election for a seat in the state House of Representatives. He did not face a GOP foe. Cahill succeeds Robert Fennell, who left the Legislature for a post with the Lynn Water and Sewer Commission.