RICHMOND, Va. — Virginia Republicans cheered Thursday when their candidate won a state House of Delegates race by luck of the draw, having his name chosen first out of ceramic bowl.

But inside a conference room in Richmond’s Capitol Square, where the drawing was held, it was all agony of defeat and no joy of victory. That’s because Republican David Yancey skipped the drawing, while Democratic challenger Shelley Simonds and many of her supporters absorbed it in stunned silence.

The drawing of lots took place after an election, recount and legal battles between Yancey and Simonds ended in a tie. Yancey’s win allows Republicans to maintain a slim majority in the House, though a final tally is still uncertain.

The drawing drew a large, if lopsided, crowd to the Virginia elections board meeting. Many were either reporters or Simonds’ supporters.

So the focus was entirely on Simonds, who sat stoically as the commission ran through the ceremony. The name of each candidate, printed on a piece of paper, was placed into separate film canisters. The canisters were put into a cobalt-blue-and-white ceramic bowl made by a local artist and stirred around.

Board Chairman James Alcorn pulled one of the canister’s out and read the winner’s name: “David Yancey.”

Without him there, all eyes fell on Simonds.

She stayed still and kept looking straight ahead, not giving any initial reaction. After a few seconds, she looked at her 15-year-daughter Georgia, and said, “it’s ok.”

The room that had been buzzing with excitement moments before went silent, save for the rapid click of the cameras trained on Simonds.

Much of the crowd, filled with state workers and aides to Democratic Gov. Terry McAuliffe and Gov.-elect Ralph Northam, quickly filed out.

After a few minutes, Simonds gave an impromptu news conference.

“This is a sad conclusion for me,” she said, sounding a lot like she was conceding defeat.

But when asked, she explicitly said her options — including a recount request, were still on the table.

For his part, Yancey’s only comments came on social media , where he congratulated Simonds on a “hard fought election.”

He left the speaking to House Republican Leader Kirk Cox and his top deputy, Del. Todd Gilbert, who were in much higher spirits when they met with reporters outside the House chamber.

“The takeaway from today is, we will be in the majority on the first day,” Cox said, referring to the 2018 legislative session that starts next week.

Republicans currently control the chamber 51-49. If Simonds pursued a recount, if wouldn’t be complete before the session starts and Cox said neither Yancey nor Simonds would be seated until a winner was finalized. That would still allow Republicans to elect a speaker and make committee assignments based on a 50-49 advantage.

The race between Yancey, a three-term incumbent, and Simonds has bounced back and forth since the November election, when Virginia Democrats — fueled by voter anger directed at Republican President Donald Trump — wiped out a 66-34 advantage held by Republicans in the House. The election has been widely seen as a potential harbinger of the 2018 midterm congressional elections.

Simonds appeared to have lost the November election by 10 votes, but on Dec. 19, she won a recount by a single vote. The next day, a three-judge panel declared a tie based on a previously uncounted vote for Yancey.

At the heart of the dispute is a single ballot on which the voter filled in the bubble for both Simonds and Yancey. The voter also drew a single slash through the bubble for Simonds and picked Republican candidates in statewide races.

The ballot wasn’t counted during the recount and was identified after a Republican election official raised concerns the following day.

After the drawing Thursday, election board members asked the public to make sure that they correctly fill out ballots in future contests.

The balance of power in the House could shift again because a lawsuit is pending over the results of another House race in Northern Virginia. Democrat Joshua Cole lost to Republican Bob Thomas by 73 votes in a recount. But voters filed a federal lawsuit after at least 147 ballots were found to be assigned to the wrong districts. A federal court hearing on that election is schedule for Friday.