Republican Scott Wyatt defeated Democrat Kevin Washington on Tuesday for a seat in the House of Delegates.
The contest for the traditionally Republican seat in the 97th District had featured a bitter fight for the GOP nomination.
Wyatt, a former Hanover County supervisor, had topped Del. Chris Peace, R-Hanover, for the Republican nod to seek the seat representing parts of Hanover and King William counties and all of of New Kent County.
That led some of his supporters to back a write-in bid for Peace on Tuesday.
Peace said in an interview last week that he was not discouraging people from writing in his name on Election Day, but he was not running a write-in campaign and was not taking part in campaign activities. He did say that others in the community were taking part in a write-in effort, including his wife, father-in-law and mother-in-law.
Elections officials said they would only report the total number of write-in votes on Tuesday night and that if the total number was fewer than 10% of the total votes cast, they would not be counted.
Wyatt said his chief reason for running was his opposition to Medicaid expansion, which he said forced Hanover "and all the other counties across Virginia to shoulder extra costs." Peace had backed Medicaid expansion when legislators approved it in 2018.
Wyatt also pledged to oppose tax increases and said he would be "a solid pro-life vote" in the legislature.
Washington, an Army veteran, works in information technology as a cloud architect for the Department of Defense. His platform called for investments in education and what he termed "common-sense gun reforms," including universal background checks and "red flag" laws.
Earlier this year a dispute among local Republican committees left both Peace and Wyatt declaring victory after two separate electoral processes.
The Republican Party of Virginia's State Central Committee eventually sided with Wyatt, ruling that Wyatt was the legitimate winner of a May 4 nominating convention even though Jack Wilson, chairman of the Republican Party of Virginia, had previously said it was "not a party-sanctioned election."
In September the chairman of the Hanover County Republican Committee asked Peace to disavow "a very public write-in campaign" run by Peace supporters.
Peace did not endorse Wyatt, but said in a brief letter to the Hanover GOP official: "I am not nor will I be a candidate for election in the November 5, 2019 general election."
Republicans have represented the 97th District since 2002. Peace has held the seat since 2006.