Update, 12:15 p.m.: Mermell called Auchincloss to concede on Friday morning. She announced in a video posted on Facebook and Twitter that she will not request a recount.

UNOFFICIAL RESULTS show Newton City Councilor and US Marine Corps veteran Jake Auchincloss narrowly defeating former Deval Patrick staffer and Brookline selectwoman Jesse Mermell to win the Democratic nomination for the 4th Congressional District House seat. The final results were released early Friday morning after two days of wrangling over uncounted ballots.

Auchincloss declared victory at 1:30 a.m. Friday. “I’m honored that the people of the Massachusetts Fourth District have chosen me as the Democratic nominee for Congress,” he said in a statement. “We won 25 of the 34 cities and towns across the district, a testament to the strong, full-district campaign we built.”

Mermell, however, has not yet conceded, and on Thursday she did not rule out the possibility of asking for a recount.

Just before 2 a.m., Mermell spokesman David Guarino said in a statement, “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 final count showed Auchincloss winning with 34,971 votes, or 22.4 percent, and Mermell with 32,938 votes, or 21.1 percent, a difference of around 2,000 votes.

Becky Grossman, a Newton City Councilor and former Middlesex County prosecutor, and the daughter-in-law of former state treasurer Steve Grossman, came in third with 18 percent of the vote. Also running were Alan Khazei, the co-founder and CEO of City Year; democratic socialist Ihssane Leckey; epidemiologist Natalia Linos; and attorney Benjamin Sigel.

The end of the race was marred with questions about uncounted ballots. As of Tuesday night, Auchincloss had held a lead of around 1,500 votes, but several communities had not yet reported their results or had reported incomplete results. On Wednesday, Secretary of the Commonwealth William Galvin sought a court order to require three communities – Franklin, Newton, and Wellesley – to continue counting their ballots after Election Day. These were ballots that had either arrived late on Election Day and were never counted or, in the case of 3,000 early-cast ballots in Franklin, were secured in a vault and mistakenly never brought to polling places for counting.

While those ballots were counted Thursday, Mermell said she had given Galvin information about other towns that potentially still had uncounted ballots. “Our message is simple, count every vote,” she said.

Auchincloss, 32, is a US Marine Corps veteran who served in Afghanistan and Panama. He previously worked at an innovation lab run by Liberty Mutual and as a project manager for a cybersecurity company. He holds a bachelor’s degree from Harvard University and an MBA from MIT’s Sloan School of Management.

He was widely considered the most moderate of the seven Democrats running as of Election Day – although he disputes that label. He was a registered Republican in 2013 and worked for Gov. Charlie Baker’s gubernatorial campaign in 2014, and refers to himself as an “Obama-Baker voter.”

In his campaign, Auchincloss talked about promoting a “green economic recovery” from the COVID-19 pandemic. He wants to expand the Affordable Care Act, though not through single-payer health care, and direct federal relief money to education, municipalities, and small businesses.

In an Election Day interview, Auchincloss referred to himself as the candidate who “can build coalitions for progress” and who is “tough enough to take on Donald Trump.” He added: “I’m able to bring people together to make progress on a transition to a clean energy economy and to beat back the coronavirus and climate change challenges.”

But Auchincloss also drew fire during the campaign for his past controversial statements. In 2016, Auchincloss criticized the city of Cambridge for “taking PC too far” by changing Columbus Day to Indigenous Peoples’ Day. The same year, he defended the free speech rights of students who flew a Confederate flag outside their school, comparing it to a Black Lives Matter banner. He had to apologize for a comment he made on social media when he was 22 that appeared to justify burning the Quran.

Auchincloss received a major campaign boost when he was endorsed by the Boston Globe, but the decision got significant pushback from readers.

Auchincloss supporter Dan Gaynor, 33, a Newton voter who works in marketing and previously worked for USAID combating the Ebola epidemic, said he believes Auchincloss is in the best position to collaborate with others and lead during a crisis. Gaynor said he was impressed by Auchincloss’ record of military service and his depth of policy knowledge.

“Jake, with his history in business, deep commitment to service, his understanding of local issues and local policymaking, is going to be really equipped not just to be a Congressperson who gets out there and makes bold statements, but  a Congressperson who’s really committed to great constituent services, particularly as it helps get the engines of our economy, small businesses, back online and running,” he said.

The 4th District is a diverse one, and the results show a clear socioeconomic class divide. The highest concentration of voters, and much of the district’s political activism, is centered in the wealthy Boston suburbs like Newton and Brookline. Mermell won the wealthier suburbs, including Auchincloss’ hometown of Newton, Mermell’s hometown of Brookline, and Wellesley, Needham, and Dover.

But the district also stretches south to the working-class cities of Fall River and Taunton. Auchincloss dominated in the southern part of the district, while Mermell barely broke through. In Fall River and Taunton, for example, Auchincloss won and Grossman and Leckey rounded out the top three vote-getters.

“Auchincloss’ background as more moderate and as a Marine I think appealed to people who live in blue-collar communities,” said Jeffrey Berry, a political science professor at Tufts University

Auchincloss also may have benefited from splitting the liberal vote.

In the last weeks of the campaign, two of the original nine candidates – tech entrepreneur Chris Zannetos and former White House speechwriter Dave Cavell – dropped out, and both endorsed Mermell. Cavell said explicitly that he wanted to avoid splitting the liberal vote and allowing the more conservative Auchincloss to prevail.

In the general election, Auchincloss will face Republican Julie Hall, who defeated David Rosa in the GOP primary. Hall, an advocate for veterans and a former Attleboro city councilor, spent more than 30 years in the US Air Force where she attained the rank of colonel.