State Sen. Mark Obenshain (R-Harrisonburg) has formally asked for a recount in the historically-tight Virginia AG race. (Steve Helber/AP)

State Sen. Mark D. Obenshain made official Wednesday his request for a recount of Virginia’s tight race for attorney general, and his attorneys predicted that the recount would be conducted over a brief, busy period in mid-December.

The Harrisonburg Republican’s campaign delivered the recount petition to Richmond Circuit Court on Wednesday morning, setting in motion a complex process that will determine who won the contest between him and state Sen. Mark R. Herring (D-Loudoun). The State Board of Elections declared Herring the winner Monday by a margin of 165 votes out of more than 2.2 million cast, making it the closest statewide race in Virginia’s history.

The attorney general’s contest isn’t the only Virginia race that remains to be resolved. Democrat Jennifer Boysko’s campaign for state delegate is expected to file a petition for a recount next week in the race against Del. Thomas D. Rust (R-Fairfax). Rust was certified the winner Monday by 54 votes out of nearly 21,000 cast, a margin of 0.26 percent.

The attorney general recount will be overseen by a special court, with the chief judge of the Richmond Circuit Court presiding. Two judges selected by the chief justice of the Virginia Supreme Court will also participate.

During a call with reporters Wednesday, Obenshain attorney Stephen C. Piepgrass said a preliminary hearing with the chief judge would be held within seven days of the recount petition being filed. The basic rules for the recount will be established at that hearing, though many of the guidelines are already enshrined in state law.

Piepgrass estimated that the recount would take place in mid-December, with most localities able to recount their ballots in a single day, although some will take two days or even three, if necessary.

Once all localities have completed their work, Piepgrass said, the recount court should be able to convene in Richmond, review any remaining disputed ballots and add up the final results.

One of the court’s main roles will be to adjudicate any disputes between the campaigns.

“We are working together with counsel for the Herring campaign to resolve as many of those issues as possible,” Piepgrass said. “Here in Virginia, we try to be civil in our litigation.”

Herring’s campaign declined to comment Wednesday on the Obenshain campaign’s move. Herring said the day before that Obenshain had the right to request a recount but that it “will not impede our efforts to build the finest team to serve all Virginians in the Office of Attorney General or prepare for the 2014 legislative session.”

During the recount, each locality will review the tapes of electronic voting machines and feed all optical-scan ballots — the kind that require voters to fill in ovals — through its machines again. Some localities may have to recount their paper ballots by hand. All provisional and absentee ballots will be counted by hand.

Special attention will be paid to “undervotes” — ballots on which votes were not cast for every race. In some cases, voters may have tried to indicate a candidate preference without properly filling in the oval, so the machines failed to record their votes.

Provisional ballots — cast by people who lacked the required identification, went to the wrong polling place or had previously requested an absentee ballot — have already been the subject of controversy, particularly in Fairfax County.

The electoral board there gave voters a later deadline to argue in person for the validity of their provisional ballots than other localities did. The board said it was acting within the law, particularly because the state’s most populous county had more provisional ballots to review than other localities did. But some Republicans objected.

Ashley L. Taylor Jr., another Obenshain attorney, declined to say how the Republican’s campaign would approach the Fairfax issue.

“At this point, it would be premature for us to focus on any single jurisdiction,” Taylor said. “I anticipate, as the process evolves, we will have, frankly, concerns about the handling of ballots in that jurisdiction and others.”

Under Virginia law, after a recount, the loser could contest the result in the General Assembly, with the winner decided by a joint session of the state House and Senate. Obenshain’s campaign has not said whether he would consider that tactic.