The Third Congressional District’s 10-Democrat primary has been a race defined by its numbers. It’s only fitting that it could take two counts to decide the winner.
As few as 52 votes separated Lori Trahan and Dan Koh a day after the polls closed, raising the prospect of a recount between the two candidates who received the most votes in the largest field of state primary congressional candidates in a generation.
Trahan, a former Capitol Hill aide, was holding an 18,368-to-18,316 vote edge over Koh, a former Boston City Hall aide, according to a tally Wednesday by the Associated Press. In a race that drew nearly 85,000 votes, the 52-vote gap amounted to a 0.06 percent difference.
But while Trahan claimed victory — she said she was “confident that I am your Democratic nominee” — Koh was already preparing to petition local election officials to count the ballots again. His campaign said it started the process of gathering the necessary 500 signatures by a Friday deadline to force a recount.
At the same time, his campaign pointed out that provisional ballots were still being counted, possibly changing the tally.
The razor-thin margin prompted Secretary of State William F. Galvin on Wednesday to order local officials to seal all counted ballots. A spokeswoman called it a “precautionary measure” in case of a recount, which could delay a final decision well into mid-September.
Rick Green, a Pepperell Republican and businessman, and Mike Mullen, an independent candidate and IT director from Maynard, are also on the Nov. 6 ballot.
Lost somewhat amid the election night drama — and ensuing uncertainty — were the circumstances of the race that pushed the two candidates above the most crowded congressional field since 1998.
Trahan, a Lowell native, campaigned heavily on her roots in the district’s largest city, where she got nearly 40 percent of the vote, according to preliminary figures.
A onetime chief of staff to former congressman Martin T. Meehan, Trahan sought to define herself as a homegrown candidate — no small difference in a race where several contenders moved to the district to run and another lived just outside its borders.
“I think that resonated across the district,” Trahan, 44, said Wednesday.
In a collection of progressive Democrats who all regularly lobbed criticisms at President Trump, Koh, meanwhile, was perhaps the loudest. The 34-year-old Andover native featured the Republican president prominently in one of his first campaign videos, moving early to tap directly into Democrats’ concerns about the White House.
The tactic appeared sound: More than 50 percent of likely Democratic primary voters polled last month said that the most important characteristic in a candidate was one who would “stand up” to Trump.
Koh, who left his post as Mayor Martin J. Walsh’s chief of staff last year to run, also built the race’s best-funded campaign, raising nearly $3.1 million.
It allowed him to launch a TV ad campaign in April that ran nearly uninterrupted through primary day.
Only one of the Democrats, of course, will advance to compete in the November election to fill the open seat of retiring Representative Niki Tsongas.
Appearing at the UMass Lowell Inn & Conference Center with about 50 supporters behind her, Trahan asserted Wednesday that she would emerge as the winner, and stressed that she is looking ahead to the Nov. 6 election.
“We cannot afford to wait a single day to start this campaign,” she said.
Speaking later in a hallway of the hotel, she said her campaign “double- and triple-checked” Tuesday night’s vote total. “We’re confident that the margin will withstand,” she said.
Trahan said she also called Ayanna Pressley earlier Wednesday to congratulate her on her victory Tuesday over incumbent Michael E. Capuano in the Seventh Congressional District. “I told her I very much look forward to serving with her in Washington,” Trahan said.
In the Third District, however, Koh has not conceded to Trahan, and, depending on how the final vote count shakes out, it could be weeks until anyone is named the winner.
Koh’s campaign said in a statement that “it’s clear that the final outcome of the election will not be known for a few days” and the campaign will be “reviewing the process for a recount to ensure everyone who voted is properly counted.”
“He is proud to have been part of a group of Democratic candidates in the 3rd who campaigned so hard to make a real difference in this country and if — at the end of this process — Lori is declared the winner, Dan will offer his enthusiastic support for her in the general election,” said the statement.
In Massachusetts, a congressional campaign is allowed to petition for a districtwide recount when the margin of victory is within a half-percent.
(The AP had the two candidates each earning 21.6 percent of the vote.)
The campaign then must collect 500 signatures and submit them to local officials by 5 p.m. Friday.
Under state law, the results must make it within a week to the secretary of state’s office, which then has to hold a recount within six days. That means, in total, there could be a 16-day window between the primary election and a conclusion to a recount, said Debra O’Malley, a Galvin spokeswoman.
“Of course we need to make sure it happens as quickly as possible,” she said.
Awaiting the winner is Green, a 47-year-old first-time candidate who has emphasized his business experience to voters. The cofounder of an auto parts company, he promised in a recent campaign video that he’ll “get the economic engine . . . revving” in the district.
“We hope this situation is resolved quickly,” he said Wednesday of the recount.
“If it devolves into a power struggle between two political dynasties, the victim will inevitably be the will of the people,” he said, an apparent reference to the backing Trahan and Koh have gotten from their former bosses.