Longtime Montgomery County Council member Marc Elrich was declared the winner of the Democratic primary for county executive Sunday, besting opponent David Blair in a tight race that came down to absentee and provisional ballots.

Just 80 votes separated the two candidates, with 37,529 votes for Elrich and 37,449 for Blair, according to election results posted to the county’s website late Sunday night.

Elrich, a progressive who has served on the county council for 12 years, and Blair, a Potomac businessman and political newcomer, had been locked in a close race since the June 26 primary, separated by just a few hundred votes, with Elrich’s lead steadily dropping with each new round of ballots counted.

But after several thousand provisional and absentee ballots were reviewed last week — and a review of the final 970 provisional ballots Sunday — Elrich emerged the victor. He attributed his win to his message to voters.

“I think for a lot of people it’s knowing that I’m really committed to trying to resize the county government,” he said. “I do think the developers need to pay more . . . but the counties need to do a lot more, which is why I put a lot of energy, organizationally, to try to make this thing run better.”

Blair, who had spent nearly $3 million of his own money on his largely self-funded campaign, is considering asking for a recount.

“With almost 130,000 votes cast, the margin of 80 votes is razor-thin, and David Blair has been gaining ground as the votes have been counted,” Blair spokeswoman Laura Evans Manatos said. “There is more work to do in this process — we still need to understand fully the scope and effect of the [state Motor Vehicle Administration’s] untimely updating of key voter registration data. We are committed to seeing that the most credible possible outcome is finally reached. Our supporters and all Montgomery county residents, deserve nothing less.”

While Democrats have often sailed to victory in November in the largely blue county, this year’s race may be marked by a third choice: Democratic at-large council member Nancy Floreen, who on July 2 filed paperwork to run for county executive as an independent.

Floreen, a 16-year council member and former Garrett Park mayor who has never lost an election, had said she was waiting for the outcome of the Democratic primary before deciding whether to go forward with her campaign.

While she said she didn’t support either candidate, she has called the prospect of an Elrich administration “a disaster for Montgomery County.”

“I’ll probably be issuing a statement within the next day or two about what my plans are, but not tonight,” Floreen said Sunday.

Democrats outnumber Republicans in Montgomery; the last Republican county executive was elected in the 1970s and voters haven’t elected a Republican to the county council since 2002. But Floreen’s possible entry into the race sparked concerns among some Democrats that she would split the vote in November, handing the office to Republican Robin Ficker.

Ficker, a lawyer, ran unopposed for the GOP nomination,

Elrich, 68, appealed to progressive groups, unions and those wary of growth with his commitment to social causes, such as the county’s $15 minimum wage legislation, and his pledge to make developers who want to build in the county pay to offset traffic congestion and school overcrowding. But his candidacy also was viewed with alarm by many in the business community who feared that he would not work to grow the county’s tax base to fund social and other programs.

Blair, 48, who founded and ran a prescription drug benefits company, ran on a platform of attracting jobs and businesses to the county. He’s spoken of reducing the energy and recordation taxes, and advocated making the county’s Ride On buses free. But his largely self-funded campaign attracted criticism from some, including other candidates, who accused him of trying to buy the election. He also was a registered Republican until 2003, and missed voting in four Democratic primaries — an omission for which he has expressed regret.

The close race was just one of many twists in a remarkable election cycle in Montgomery, the state’s most populous jurisdiction. The county’s new public campaign financing system and voter-approved term limits yielded a large crowd of hopefuls for the county executive and county council; 33 Democrats vied for four at-large seats alone.

Remaining unclear is whether Floreen, still a registered Democrat, will be allowed to run as an independent. While she said she plans to reregister as unaffiliated on Monday — the first chance to change registration since the June 26 primary — she acknowledged questions have been raised about whether the declaration of intent to run she filed on July 2 was valid.

Kevin Karpinski, attorney for the county Board of Elections, said the board accepted Floreen’s filing “pending legal review,” and that a determination would be made on whether it is valid by Monday.