Virginia is on the cusp of expanding Medicaid under the Affordable Care Act, which would extend health coverage to up to 400,000 of the state’s poorest residents.

The big break came on Friday, when Republican state Sen. Frank Wagner announced he would support Medicaid expansion (with some conditions), which could give the proposal enough votes to pass as part of the state’s budget. Republicans control the Virginia Senate by a narrow 21-19 margin, and Wagner was the second of two GOP senators needed to support expansion.

Even since Democrat Ralph Northam won the governor’s mansion in November, dramatically narrowing the GOP’s House majority, Medicaid expansion has been the top item on the state’s agenda. The house has already passed a version of the proposal, but the Senate had refused to go along. The two chambers have been at an impasse for the last month; the legislature reconvenes this week to try to pass a budget, which would be the vehicle for Medicaid expansion.

“I’m optimistic. I’m a the-glass-is-half-full person,” Northam told Vox recently. “This is something that we’ve been working on for five years now, to make sure that all Virginians have access to affordable and quality care.”

The support of Wagner and Republican Sen. Emmett Hanger Jr. comes with some conditions, the Washington Post reported. Wagner wants to expand tax credits for middle-class people who buy private coverage in exchange for expanding Medicaid to poorer people (a family of three making $27,000 or less qualifies) and Hanger has some concerns about how the state picks up its share of the tab (10 percent, while the federal government covers the rest).

The finer details will be negotiated in the coming days. Lawmakers and Northam also need to agree on whether to require Medicaid enrollees to work; Republicans in the legislature support work requirements, but Northam told Vox he did not want to “penalize” people and take away their health coverage for failing to comply.

As long as Wagner and Hanger stay onboard and compromises on those issues can be reached, Virginia should soon expand Medicaid.

It would be the first state to officially accept Medicaid expansion under President Donald Trump and the 34th overall. To date, 18 mostly Republican-led states have refused to expand Medicaid under Obamacare, leaving an estimated 4 million people without health coverage.