After many failed deals and several delays, Virginia lawmakers have finally approved Medicaid expansion.

The state Senate approved expansion as part of its budget by a 23-17 margin on May 30, a month before the current budget was set to expire. Four Republicans joined the 19 Democrats in voting for a deal that will provide coverage for 400,000 low-income people in the mid-Atlantic state.

The state's House of Delegates passed an expansion amendment earlier this year. But it was held up in the Senate where it had stalled was delayed for months as GOP lawmakers struggled to decide how to vote.

Digital Transformation Unlock the Digital Front Door with an App The Member Mobile App is the smarter and better way to engage members anytime and anywhere. Members can find the right doctors, receive alerts, track spending, use telehealth, and more — all within a guided, intuitive, and seamless experience. Built exclusively for payers, it is ready to install and launch in a few months. Request a consult on how to enable the digital front door with the Mobile App, today. Request a Consult

Hours after the Senate's approval, the House voted and passed the compromise bill 69-29, which now heads to the governor's desk. Democratic Gov. Ralph Northam, who has campaigned for Medicaid expansion and pushed for both sides to reach an agreement, is expected to sign it.

RELATED: Is Maine's Medicaid lawsuit a harbinger for other anti-expansion governors?

On Thursday, prior to the vote, Northam said the administration is aiming to implement the policy in January 2019.

“We have the ability to move something through that’s very sure in these uncertain times,” state senator Emmett Hanger, Jr., a Republican sponsor of the compromise bill, said on the floor. “We can develop a uniquely Virginia plan. While it draws from the experience of many states that have been out there before us, it will serve our citizens.”

National Democrats, including Virginia Sens. Tim Kaine and Mark Warner, praised the passage.

"The bipartisan vote is a long-overdue step towards giving hundreds of thousands of Virginians access to healthcare," Kaine said on Twitter.

One final thought about Roseanne is that we just expanded Medicaid in Virginia so we should talk about that a ton. — Brian Schatz (@brianschatz) May 31, 2018

However, in a compromise move, Virginia will start implementing Medicaid work requirements starting in 2020 as a way to keep program costs down.

With Northam's signature, only 17 states will not have expanded Medicaid under the Affordable Care Act. However, the Commonwealth might not be the last state that approves Medicaid expansion this year.

Utah added Medicaid expansion to its November ballot, and Idaho has been pushing to put a similar measure before voters. Meanwhile, recent polling augers well for expansion advocates.