The Senate on Wednesday gave overwhelming approval to a massive bill that expands access for veterans to private doctors at taxpayer expense, sending President Trump a victory that helps cement one of his biggest campaign promises.

The VA Mission Act, which cleared the Senate by a vote of 92 to 5 and the House by a wide margin last week, was expected to reach the president’s desk as soon as Memorial Day.

The $55 billion package makes a five-year commitment to addressing shortcomings in the country’s largest health system, which still struggles with delays after a 2014 scandal in which VA employees were found to have fudged patient wait lists.

About one-third of veterans in the system now see outside doctors through a program called “Choice,” which Congress hastily approved as a temporary remedy in response to the scandal. But the program — designed to serve the overflow at VA facilities both of aging Vietnam-era veterans and younger service members returning from the wars in Iraq and Afghanistan — is fragmented and unwieldy. Doctors have complained of slow or nonexistent payments, and veterans say there’s insurmountable red tape.

“The Choice program has been a wreck, okay?” Sen. Jon Tester (Mont.), the Senate Veterans’ Affairs Committee’s top Democrat, said this week.

The Congressional Budget Office estimates that as a result of the VA Mission Act, an additional 640,000 veterans each year would go outside the system. The bill would require VA for the first time to negotiate a contract for veterans to seek care at private walk-in clinics, a shift now being tested in Arizona as part of a pilot program with the drugstore chain CVS.

Tester and Committee Chairman Johnny Isakson (R-Ga.) negotiated the bill with the White House and veterans groups over the past year, during which Trump fired his VA secretary, nominated a White House physician as a replacement whose nomination fell apart after claims of misconduct surfaced.

Isakson acknowledged this week that the turmoil had slowed progress on the legislation. After Wednesday’s Senate vote, he said in a statement that veterans “will benefit from more choice and fewer barriers to care.”

Allowing more private care was a key campaign promise made by the president, for whom veterans are an important constituency.

Lawmakers reached a bipartisan compromise that balances a push by the White House, Republicans and conservative veterans groups for unfettered access to private care with the concerns of Democrats and traditional veterans service groups who fear that VA, under Republican rule in Washington, is heading toward a privatized system.

The largest federal employee union, which represents about 200,000 VA civil servants, has been outspoken in its opposition to the bill and this week sent a letter to every Senate office co-signed by 16 labor groups urging a “no” vote.

The American Federation of Government Employees said in a statement that the legislation “kicks the door wide open to VA privatization, no matter what its supporters claim,” by curtailing investment in the 1,200 VA hospitals and clinics and instead sending money and veterans to private doctors who offer “costly and unaccountable” private care.

Keith Harman, national commander of the 1.7 million-member Veterans of Foreign Wars, acknowledged in a statement that the bill “is the result of years of negotiating what role the private sector should play” in providing care to veterans. But he said it “strikes the right balance in order to make sure veterans have the best care possible.”

Robert Wilkie, Trump’s new nominee for VA secretary, will be charged with writing the bill’s fine print, the rules that set parameters for when a veteran can see a private doctor. They will be closely scrutinized by veterans groups.

Funding for the bill, including $5.2 billion to continue the current Choice program for a year, must still be approved by Congress.

The VA Mission Act would replace Choice by consolidating VA’s multiple private-care programs and contracting with an outside company to streamline billing.

It would require the agency to allow a veteran to see a private doctor if they agree with their VA physician that it’s in their best interest. A number of factors would be taken into account, including if the veteran lives far from a VA hospital, if the wait for an appointment is too long and if the care at the closest VA hospital is “deficient” compared with other private and VA medical offices. The veteran could appeal if the request was rejected.

The standards are far broader than the current rules, which limit private care to those who live more than 40 miles from a VA facility or who must wait more than 30 days for an appointment.

The legislation also gives veterans groups a victory by expanding VA’s popular caregiver program, extending stipends and other benefits to veterans of all eras, not just families of injured post-9/11 veterans.

VA also would be required to do a review of all of its underused hospitals, leading to possible closures, a victory for conservatives. An existing telehealth program would expand and VA would get new tools to recruit medical professionals to address thousands of vacancies.