RICHMOND, Va. — The long-running fight for control of the Virginia House of Delegates isn’t over.

A federal judge is set to hear arguments Friday in a federal lawsuit challenging the results of a House race after numerous voters were assigned to the wrong district and thus given the wrong ballots. Democrat Joshua Cole lost the Fredericksburg-area seat to Republican Bob Thomas by 73 votes in a race that went to a recount.

The court hearing comes a day after Republican David Yancey won a different seat when his name was drawn from a bowl. The hearing is the latest chapter in a November election — fueled by voter anger directed at Republican President Donald Trump — that saw Democrats wipe out a 66-34 advantage held by Republicans in the House.

That advantage is now down to 51-49.

Thursday’s drawing of lots took place after an election, recount and legal battle between Yancey, the incumbent, and Democratic challenger Shelley Simonds ended in a tie.

The drawing drew a large, if lopsided, crowd to the Virginia elections board meeting. Many of the people packed into the room were either reporters or Simonds’ supporters. Yancey did not attend but did have a few GOP staffers there to watch.

The name of each candidate was printed on a piece of paper and placed into separate film canisters. The canisters were put into a cobalt-blue-and-white ceramic bowl made by a local artist, stirred around and Yancey’s name was chosen first.

As Yancey’s name was announced by Board Chairman James Alcorn, Simonds sat stoically, holding the hands of her daughter and husband seated beside her. There were no cheers from Yancey’s few supporters. The electric mood went suddenly still.

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.”

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 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. He also said he felt confident that the federal lawsuit would not undo Thomas’ victory.

In that race, officials discovered after the election that at least 147 ballots were found to be assigned to the wrong districts. Some voters, represented by a law firm closely aligned with the Democratic Party, want to void the election results and have another one.

Local elections officials who oppose ordering a special election say the voters who filed suit should have taken action before Election Day to have their House district assignment corrected.