WASHINGTON — Lady luck registered as a Republican Thursday, handing the party a victory in an unusual lottery to determine the outcome of not only a tied Virginia House of Delegates race, but control of the entire chamber.

With the outcome, Republicans are set to maintain their narrow 51-49 majority in the state House — though Democrats indicated they may still call for another recount, meaning the saga is not quite over yet. Republicans also control the state Senate, while the governor is a Democrat.

After a dramatic contest between incumbent Republican David Yancey and Democratic challenger Shelly Simonds, which included a recount and several legal challenges, the race for the 94th District of the House Delegates came down to a random drawing — a first for the state since 1971.

State officials conducted the event with a certain amount of pomp. The name of each candidate, typed on a piece of paper, was displayed to the crowd of onlookers and sealed inside a film canister. The two canisters were then placed inside a blue stoneware bowl made by a Virginia artist and selected by the curator of a local museum as Thursday's vessel for democracy.

The chairman of the Virginia State Board of Elections, James Alcorn, then pulled the first canister out of the bowl and revealed that Yancey had won.

Clara Belle Wheeler, the board's vice chair, called it an "unprecedented event" in Virginia history, noting that while tied races have been decided by lottery in the past, the stakes had never been high enough to tip the balance of the state's storied legislative body.

"This has never been done before for the longest-running, oldest legislative body in the New World," Wheeler said.

If Simonds had won, the House would have been split 50-50 and the parties would have had to enter a power-sharing agreement to determine the speaker, committee chairs and other issues.

Simonds, speaking to reporters after the drawing, refused to concede and left the door open to a second recount, as permitted under state law. She noted that she had offered Yancey a deal in which both candidates would accept the outcome of the lottery as final, but Yancey did not accept.

"Therefore, for me, all options are still on the table," she said.

Simonds, a school board member and former teacher, also said she plans to run again in 2019, which would be her third bid for the seat.

The result of the random drawing is sure to spark outcry from Democrats, who note Simonds had been declared the winner before a court intervened to allow a dubiously marked ballot to count for Yancey.

David Cohen, the founder of Forward Majority, a liberal super PAC focused on state legislative races, declared in a statement that "the election was stolen from Shelly Simonds and rigged by Virginia Republicans."

Yancey, who did not attend the random drawing ceremony, said in a statement that he looked forward to getting back to work.

"The election is behind us, the outcome is clear, and my responsibility now is to begin the work I was re-elected to do," the Republican said.

Kirk Cox, who is expected to be elected speaker now that Republicans will retain majority, said there was no time left to debate the election since the House of Delegates is set to open for this year's business in just six days.

"The past few weeks have been unprecedented to say the least, but the process laid out in state law worked," Cox said in a statement. "[T]he people of the 94th House District deserve representation on opening day."

The race attracted limited attention before Election Day, but an overtime battle that took more turns than the James River made national headlines.

At various moments, each candidate had been declared the apparent winner, and House Republicans even conceded the race at one point. However, a previously uncounted ballot for Yancey tied up the race, 11,607 votes to 11,607 votes.