When a Virginia elections official pulled a name out of bowl on Thursday, he didn’t only hand Republicans a 51-49 majority — the tiebreaker will also make it a little harder for the state to expand health coverage to 400,000 low-income Virginians.

Virginia Democrats won the governor’s seat on Election Night and very nearly swept to a shocking takeover of the state House. But they fell short after recounts and Thursday’s tiebreaker in the race between Republican David Yancey and Democrat Shelly Simonds (both got 11,608 votes) left the GOP hanging onto a bare majority.

Medicaid coverage for hundreds of thousands of low-income Virginians has been at stake throughout the campaign and the last month of recounts and bowl drawings.

Democratic Gov. Terry McAuliffe and Virginia Republicans in the statehouse have been locked in battle for years over expanding Medicaid under Obamacare. Virginia is one of the 19 states that has refused to expand its Medicaid eligibility as the health care law allows.

The state estimates that more than 400,000 people in and near poverty have been denied Medicaid coverage as a result.

Democrats — on the back of the landslide win by Ralph Northam to take the governor’s seat — very nearly won enough seats to take control of the Virginia House of Delegates. They could have voted as soon as January to expand Medicaid, which Northam pledged to do if he was elected.

But they came up just short. Here is Vox’s Andrew Prokop:

Incumbent Delegate David Yancey (R) led his challenger Shelly Simonds (D) by a mere 10 votes heading into a recount. That’s the sort of margin that often shifts during a recount, due to errors in the initial tally. So the recount for the 94th District took place in December — with observers and lawyers from both campaigns, as well as many journalists, in attendance so as to prevent any mischief. And at the end, the margin shifted just enough to give Simonds the victory — 11,608 votes to 11,607. That, it seemed, would have flipped a 16th GOP-held seat to the Democrats and put the House of Delegates at 50 seats for each party. But when the outcome was presented to judges, Yancey’s campaign argued that one ballot hadn’t been counted, but should have been. The ballot had bubbles for both Yancey and Simonds filled in, but there was a line drawn through the bubble for Simonds — suggesting that the voter may have crossed out his or her Simonds vote. The recount overseers hadn’t counted this ballot, but the judges sided with Yancey and agreed that that seems like it was meant to be a vote cast for him. And since that would make the race tied at 11,608 votes to 11,608, they declined to certify a winner. So in accordance with state law, the board of elections held a random drawing to determine which candidate would win — and Yancey got lucky.

A Democratic win in the bowl drawing wouldn’t have guaranteed Medicaid expansion. Democrats and Republicans would have negotiated a power-sharing agreement in the House and the Republican-led Senate would have still stood in the way. State senators don’t face reelection in 2019.

But it would have made the task of expanding Medicaid easier. House Democrats would have needed to win over just one Republican to pass a bill expanding the program. The state Senate, while still under Republican control, has actually voted before to expand Medicaid, albeit with an alternative plan, in which Medicaid dollars would buy used to buy people private health coverage.

The House, which was more firmly in Republican hands, has always been the bigger problem. But now the Republican majority is hanging by a thread.

It’s possible Virginia’s GOP lawmakers will see this Democratic wave and decide, given their narrow margins, it’s in their best interest to pass Medicaid expansion. Public polling has consistently found that Virginia voters support expanding Medicaid, and Republicans have only a 21-19 edge in the state Senate.

Or Democrats could win the Virginia Senate back in 2019 and take over the House, while Northam is still in office. That would also pave the way for Medicaid expansion, after a little longer wait. For hundreds of thousands of Virginians, it might now be only a matter of time before they’ll have access to health care.

The biggest barrier to expanding Medicaid in Virginia had been electing a Democratic House. That didn’t quite happen — but it’s a whole lot closer to being a reality.