The race for the 1st Middlesex District in the state House of Representatives could be headed for a recount. 

As of Wednesday evening, Republican Andrew Shepherd lead Democrat Margaret Scarsdale by fewer than a dozen votes. The district covers the towns of Ashby, Dunstable, Pepperell, Townsend and parts of both Groton and Lunenburg. 

Election workers in Pepperell, Dunstable and Groton are meeting this week to count additional late-arriving ballots.

"We had to do a couple hand counts this week," Groton town clerk Dawn Dunbar said. "And then on Monday morning, the board of registrars is doing one final federal write-in ballot hand count and we will be able to certify our vote."

Both candidates have already picked up petitions to seek a district-wide recount. They'd need to submit those petitions to the secretary of state's office by 5 p.m. Friday.

Most of the communities in this new 1st Middlesex District were represented by Republican Sheila Harrington for more than a decade. She resigned in February after Gov. Charlie Baker named her the clerk magistrate of Gardner District Court.