Staffers from Secretary of State Bill Galvin's office found roughly 3,000 uncounted ballots in the town's vaults Thursday, according to an office spokesperson, where they had expected to find just around 600 instead.

After receiving a court order allowing municipalities to count the ballots two days after election night, officials in Franklin gathered Thursday under the supervision of the Secretary of State to hand count the ballots.

The affair spilled over into the early morning hours Friday, as results allowed for some closure in the race to replace Congressman Joe Kennedy III, who opted not to seek reelection so he could lodge a challenge to longtime Sen. Ed Markey. Markey was reelected Tuesday.

"I’m honored that the people of the Massachusetts Fourth District have chosen me as the Democratic nominee for Congress," Auchincloss tweeted early Friday. "We won 25 of the 34 cities and towns across the district, a testament to the strong, full-district campaign we built."

Mermell's side stopped short of conceding early Friday morning.

In a text message, campaign spokesperson Karissa Hand said: "We appreciate the long hours put in to counting the votes and will have more to say after we have a chance to review."

The campaign has until the end of the day Friday to request a recount.

In Franklin, all of the ballots in question are believed to have been submitted by mail, according to Galvin’s office. The spokesperson said these ballots were supposed to have been sent to polling places on Election Day, though it appears they were never sent.

By 8 p.m. Thursday, about 30 poll workers sat at folding tables, counting blocks of ballots. Members of Franklin’s Town Council declined to speak to WBUR, directing requests for comment to Galvin’s office.

“I don’t think there was any ill will or ill intention in missing these ballots, I think folks were just a little overwhelmed with everything that’s going on,” said Alex Psilakis, policy and communications manager at the nonpartisan advocacy group MassVOTE, who came to Franklin High School to observe the vote tabulation.

Pilskas said Franklin's experience can offer the state some lessons for the November election.

“It means we’ve got some work to do," he said. "We’re fortunate that this has happened in a small town like Franklin—the last thing we want to see is something like this happen in Boston or Worcester.”

This story comes from the New England News Collaborative, eight public media companies, including The Public's Radio, coming together to tell the story of a changing region, with support from the Corporation for Public Broadcasting.