The State Board of Elections voted Friday to certify Del. Lynwood W. Lewis Jr. (D-Accomack) as the winner of a Senate special election by just nine votes, and his Republican foe made clear he would ask for a recount.

Lewis and Wayne Coleman (R), the owner of a Norfolk shipping company, squared off Tuesday in the contest to fill the Hampton Roads-based seat of Lt. Gov-elect Ralph Northam. The outcome of the race, and the Jan. 21 special election to succeed Attorney General-elect Mark Herring (D), will determine which party controls a Senate that had been split 20-20.

Lewis’s edge of nine votes — .04 percent — entitles Coleman to ask for a government-funded recount.

“In the days to come I will be requesting a recount,” Coleman said in an e-mail to supporters, asking for contributions to cover his legal fees.

This recount will be less complicated than the statewide one completed last month in Herring’s race for attorney general. But it could still take at least two weeks to complete, leaving Northam’s seat vacant in the interim. (Northam officially resigns from the Senate Saturday, when he will be sworn in as lieutenant governor.)

Democrats went into the special election believing they had a clear advantage; President Obama took 57 percent of the vote in the 6th district in 2012. But Republicans worked hard on their ground game and were able to get their voters to the polls even though special elections typically have low turnout.

Lewis led by 22 votes on Election Night but his margin narrowed as local election boards canvassed their results. At one point Wednesday, the canvassing process was delayed because a boat carrying ballots was stuck on tiny Tangier Island because of ice in the Chesapeake Bay. Coleman won the Tangier precinct 166-7.