(Reuters) - Republicans could hold onto control of Virginia’s legislature after a race that had appeared to change the balance of power was ruled a tie on Wednesday, setting the stage for the winner of the district to be chosen by lot.

The results of a recount on Tuesday showed Democrat Shelly Simonds beating Republican incumbent David Yancey by one vote, enough to shift the 100-member House of Delegates to an even 50-50 split between Democrats and Republicans.

However, on Wednesday a three-judge panel ruled that a disputed ballot should be counted for Yancey, the Virginian-Pilot newspaper reported and Yancey confirmed.

The two candidates in the 94th District, which includes Newport News in southeastern Virginia, are now tied at 11,608 votes.

Under Virginia law, a tie in a House race should be decided by drawing lots, the equivalent of a coin toss or drawing straws, the Conference of State Legislatures said.

“I am happy that every vote in Newport News was counted and that the judges took time to deliberate before rendering a decision,” Yancey said in an emailed statement. “This certainly is a historic election in our Commonwealth.”

But Democrats slammed the decision, calling it erroneous and saying they were considering legal action to challenge it.

Just Tuesday, Republicans conceded the seat, and Simonds, who made international news with what had appeared to be a narrow win, spent the morning Wednesday discussing the race on a variety of news shows.

She did not immediately respond to a request for comment following Wednesday’s decision, but an attorney for the Virginia House Democratic Caucus criticized the judges’ move in a news release.

“Today’s decision by the court was wrong, and Delegate-elect Shelly Simonds should have been certified the winner,” he said. “We are currently assessing all legal options before us as we fight for a just result.”

Democrats claimed historic gains in Virginia’s statehouse last month, part of the party’s first big wave of victories since Republican Donald Trump won the White House last year.

Before the Nov. 7 general election, Virginia Republicans held 66 seats to the Democrats’ 34 in the House of Delegates, along with a majority in the state Senate.