Updated

The State Board of Elections on Monday confirmed Democrat Mark Herring's victory over Republican Mark Obenshain in a historically close race for attorney general that appears headed to a recount.

While the elections board unanimously certified Herring's 165-vote edge, the board's Republican chairman did so with reservations because of concerns about what he called inconsistencies by localities tallying the vote, an observation that is likely to add fuel to Obenshain's expected decision to seek a recount. He has 10 days to do so.

As he has done in the past, Herring declared himself Virginia's next attorney general in the closest statewide race in modern Virginia history.

The narrow margin for Herring was unchanged from the canvass done by local elections officials nearly two weeks ago. Provisional ballots and tabulation errors that were corrected in localities including Richmond and Fairfax County added to Herring's lead after the Nov. 5 election.

Board chairman Charles Judd cited a lack of uniformity among localities in counting absentee and provisional ballots, or votes contested because a voter lacked the proper identification or voted at the wrong precinct.

"My vote to certify this election will be with question," Judd said after the board voted. "I'm concerned with the integrity of the vote."

After the meeting, Judd denied he was making the case for a recount, but said instead his concern was making sure future statewide votes are conducted uniformly.

"I'm not inviting a challenge," said Judd, adding that a recount is "very likely." ''I'm concerned about the lack of uniformity, that there be no differences in any of the localities in how votes are counted," he said.

In Fairfax County, for example, Republicans complained the local election board extended too much time for voters to appear to argue that their provisional ballots be counted.

"I personally have concerns about Fairfax County and the process of their canvass," Judd said. While the board's role in the election is over, he said he would meet with election officials in that heavily Democratic county to ensure there is no confusion in the future.

Fairfax County election officials insisted then they were hewing state election law, and they repeated that assertion on Monday.

"My response is basically what we've been saying," said Brian Schoeneman, the secretary of the Fairfax County board. "The Fairfax County Electoral Board followed Virginia law and State Board of Elections guidance in how we handled the November 2013 General Election. "

Schoeneman, a Republican, said he was concerned that Judd's comments were suggesting the "false perception" that the handling of provisional ballots altered the statewide race, "which is simply untrue."

Before the state's certification, Herring and Obenshain each named transition teams to succeed Attorney General Ken Cuccinelli, who fell short in his Republican bid for governor. Their positions were unchanged Monday.

"I am gratified that the State Board of Elections today certified me as the winner of a close but fair election," Herring said in a statement. "I look forward to serving the people of Virginia as attorney general."

Obenshain's campaign said he would continue to review the vote before deciding whether to seek a recount.

"Margins this small are why Virginia law provides a process for a recount," Obenshain's campaign manager Chris Leavitt said in a statement. "However, a decision to request a recount, even in this historically close election, is not one to be made lightly."

Virginia does not provide an automatic recount, but it does allow for a candidate to seek a recount at taxpayer expense if the margin of victory is less than one-half of 1 percent. Herring's lead over Obenshain is well within that margin out of more than 2.2 million votes cast.

In a recount, Obenshain's best hope would likely involve challenges of absentee or provisional ballots.

Overseeing everything would be a recount court. It would include the chief judge of the Circuit Court where the recount petition was filed — Richmond, in this case — and two other judges appointed by the chief justice of the Virginia Supreme Court.

Virginia law also provides for an unsuccessful candidate to "contest" the election, based on "specific allegations which, if proven true, would have a probable impact on the outcome of the election."

That would send a disputed election to the majority Republican General Assembly, which would meet in joint session.

"They can reverse the election, declare somebody a winner, or order a special election — do it all over again," said Robert Roberts, a political science professor at James Madison University.

Obenshain has signaled what steps he will takes to ensure every vote is counted, up to a recount, but has not mentioned the possibility of contesting the race.

Obenshain represents the Harrisonburg area in the Virginia Senate, while Herring represents parts of Loudoun and Fairfax counties.