House lawmakers approved sweeping legislation Wednesday that changes rules dictating when veterans can go outside the Department of Veterans Affairs for medical treatment, which fulfills a promise made by President Donald Trump to give veterans more choice over their health care.

Lawmakers voted 347-70 in favor of the bill. The vote comes after more than a year of negotiations between Republicans and Democrats about changes to the VA’s private-sector care programs. The Congressional Budget Office estimated the bill would cost nearly $52 billion.

In addition to altering eligibility criteria for veterans to access private-sector health care, the bill would extend benefits for veteran caregivers and initiate a nationwide review of VA infrastructure, among other reforms. Rep. Phil Roe, R-Tenn., the chairman of the House Committee on Veterans’ Affairs, called it transformational.

“Together, these provisions would fortify the VA health care system and make sure it stays strong and able to provide the care that it’s meant to provide,” Roe said on the House floor. “This is a historic opportunity to fundamentally shape and improve the second-largest agency in the federal government. The real winners here are our veterans.”

The bill is named for Sen. John McCain, R-Ariz., and Rep. Samuel Johnson, R-Texas, both of whom were prisoners of war in Vietnam, as well as Daniel Akaka, a World War II veteran and former Democratic senator from Hawaii who died in April. Its short title is the VA Mission Act.

The Mission Act now goes to the Senate. Leaders of the Senate Veterans’ Affairs Committee support the legislation, but it’s uncertain when the chamber might act on it.

“I applaud today’s bipartisan House action, and I urge the Senate to follow suit and quickly pass this legislation so we can send this bill to the president’s desk,” Sen. Johnny Isakson, R-Ga., said in a prepared statement. Isakson is the chairman of the Senate Veterans’ Affairs Committee.

Congress is facing a tight deadline. The VA Choice program, the private-sector care program that would be replaced by the new rules outlined in the Mission Act, is struggling with another in a series of budget shortfalls. Acting VA Secretary Robert Wilkie warned lawmakers last week that the Choice program would run out of money as early as May 31, at which point veterans won’t be able to secure appointments with private doctors.

The Mission Act provides $5.2 billion in immediate funding to keep the Choice program operating until the new system is put into place next year.

Through Twitter, Trump has repeatedly called on Congress to pass the Mission Act by Memorial Day, which falls on May 28.

“House votes today on Choice/MISSION Act. Who will stand with our Great Vets, caregivers and Veterans Service Organizations?” Trump wrote Wednesday in a tweet.

In addition to the $5.2 billion for the Choice program, the Congressional Budget Office estimated it would cost $46.5 billion to implement the Mission Act during the next five years and increase spending by $4.5 billion from now until 2028.

To offset some costs, the bill proposes to extend pension reductions for Medicaid-eligible veterans in nursing facilities and continue fees on VA-guaranteed home loans. The cuts were put in place in 2014 when the Choice program was first created. They were set to last until Sept. 30, 2024. The bill would move the end-date through Sept. 30, 2028.

During debate on the future of the VA Choice program, many veterans organizations worried unfettered choice for veterans would erode VA resources and eventually dismantle the agency – an occurrence often referred to as “privatization.”

After former VA Secretary David Shulkin was fired in March, he blamed his ouster on disagreements with White House insiders over the program. He said they viewed him as an “obstacle to privatization” of the VA.

But the Mission Act has near-unanimous support from lawmakers, the VA, the White House and dozens of veterans organizations who celebrated its passage Wednesday.

In its report on the Mission Act released this week, the CBO said the bill is written in a way that would maintain the VA as a gatekeeper to decide when veterans would go into the private sector.

The Choice program allows veterans to seek care in the private sector only if they live more than 40 miles driving distance from a VA facility or have an estimated wait of more than 30 days for an appointment with a VA provider.

The Mission Act would require the VA to grant veterans access to the private sector if veterans and their VA doctors agree it’s in their best interest. A host of issues could be considered when making that decision, including whether the veteran faces an “unusual or excessive burden” to accessing a VA facility.

“Many of the regulations that need to be written to implement the program could curtail use,” the CBO report states. “For instance, VA would probably require all veterans to be seen by a VA provider before being referred for community care.”

The American Federation for Government Employees, a union that represents hundreds of thousands of VA employees, remains opposed to the bill. AFGE claims it will “starve the VA for resources.” National Nurses United, the largest organization of registered nurses, wrote to lawmakers, also warning the bill would lead to privatization.

Some Democrats took issue with aspects of the bill, though they generally agreed with most of it. Rep. Tim Walz, D-Minn., the ranking Democrat on the House Committee on Veterans’ Affairs and a key negotiator on the Mission Act, voted against it Wednesday because he worried it would create funding troubles for the VA next year and in the long term. The increased spending for the bill could trigger potential cuts when budget caps are reinstated, he said.

“I agree these reforms are needed, and I agree these programs were debated in a logical, fair and open manner. We got much of what needed to be done in this,” Walz said. “But I’m suggesting we budget honestly in this so we don’t reach a nightmare scenario.”

“We are going to run up against that conversation next year,” he said. “The question is, will we have the courage to stand up together and fund those priorities? We have to stand up and say yes to those dollars.”

Walz and other Democrats also expressed concerns Wednesday about Congress approving major VA reforms without knowing who will implement them. The agency has been without a permanent secretary since Shulkin was dismissed in March. White House physician Ronny Jackson, Trump’s pick to replace Shulkin, withdrew from consideration in late April. A new nominee has yet to be named.

“I am also concerned that without strong leadership in place, this bill will give the Trump administration the cover it needs to slowly privatize VA,” Walz said. “Especially if VA is required to cut spending on care provided in VA hospitals, or cut funding for much needed construction and maintenance.”