Grasping at straws is one way to win an election, at least in Virginia.

A Democrat's stunning one-vote victory in a hotly contested race for the Virginia House of Delegates this week suddenly became a tie on Wednesday after a three-judge panel ruled that an additional ballot should have been counted for the Republican.

Now, the winner will be determined "by lot," according to state law, and that could mean pulling a name out of a hat, a coin toss — or drawing straws.

The state Board of Elections said it hadn't decided on the next move.

"Once the court has issued a final order, we can better evaluate what next steps are necessary for the State Board of Elections or Department of Elections to take," said Department of Elections Commissioner Edgardo Cortes.

On Wednesday, Democrat Shelly Simonds was declared the apparent winner in the race for the 94th District, beating incumbent Republican David Yancey after a wild recount had Simonds ahead by one vote, flipped a red seat to blue, and created a 50-50 tie between the two parties in the Virginia House.

She won by 11,608 to 11,607, according to the nonpartisan Virginia Public Access Project. But the final tally now stands at 11,608 to 11,608.

Gary Anderson, the Newport News Circuit Court clerk, told NBC News that Yancey's camp brought a statement to the judicial hearing on Wednesday from a county official stating that the official had made a mistake by not counting a ballot during the recount.

The ballot in question had a bubble filled in for Ed Gillespie, the Republican who lost the governor's race in November, Simonds and Yancey. However, the bubble for Gillespie had an X mark and the bubble for Simonds had a slash-like mark. Anderson said the judges took the filled in bubble for Yancey, which was not crossed out, as intent to vote for him.

Judges have been in recess for two hours. Debating whether or not to count a ballot that looks somewhat like this. They would not allow photos of the actual ballot. pic.twitter.com/1GAJBWoTrM — Jordan Pascale (@JWPascale) December 20, 2017

James Alcorn, chairman of the state Board of Elections, told The Richmond-Times Dispatch that ties are "rare," but they have been seen in local elections.