State Sen. Mark Obenshain will formally ask for a recount in the historically tight race for Virginia attorney general, his campaign announced Tuesday, leaving the final outcome still unclear three weeks after Election Day.

The State Board of Elections certified the results of the contest Monday, with state Sen. Mark Herring (D-Loudoun) declared the winner by 165 votes out of more than 2.2 million cast over Obenshain (R-Harrisonburg). The narrowness of that result — the closest statewide race in modern Virginia history -- is well within the margin for the loser to request a recount that will be paid for by the state.