The Senate on Thursday approved legislation by a vote of 91-4 that would give the Veterans Affairs Department budget flexibility to avoid closing hospitals this summer.

The upper chamber passed the House’s short-term, three-month highway spending bill, which also includes provisions that allow VA to use $3.3 billion from the Choice program for other non-VA care for vets from May 1 to Oct. 1, 2015. The department recently told lawmakers that they needed to shift budget funds to cover a $2.5 billion shortfall in the department’s Community Care programs; without the fix, they said that the department might have to close health care facilities, furlough workers and freeze hiring starting in August.

Because of the impending congressional recess, the Senate was forced to take up the House’s stop-gap bill to avoid shutting down infrastructure projects – which the lower chamber passed on Wednesday -- but also to fix the VA budget problem. The House’s short-term highway spending bill extends funding, which runs out Friday, for road, transit and bridge projects through Oct. 29. The House has left town for August recess, and the Senate heads home next week.

The measure now heads to President Obama.

Before approving the House version of the highway bill that included the VA budget fix, the Senate passed its own version of the transportation and infrastructure highway bill, which funds such projects for six years. It’s unclear whether the House will take up that version when lawmakers return from recess after Labor Day.

Once again, this Congress comes to rescue a mismanaged Department of Veterans Affairs. Rep. Jeff Miller, R-Fla., House Veterans’ Affairs Committee chairman

The VA budget fix also would require the department to develop a plan to consolidate all non-VA care programs into one “Veterans Choice Program” and report to Congress on it by Nov. 1. In addition, it would expand the Choice program, which allows certain vets to receive health care temporarily outside the VA if the department is unable to schedule an appointment for the veteran within 30 days, or the veteran lives more than 40 miles from a VA facility. The new measure inserted in the House highway bill would eliminate a requirement that eligible vets had to be enrolled in VA health care as of Aug. 1, 2014; it also would allow vets access to non-VA health care when the nearest VA facility within 40 miles driving distance does not provide the care the vet needs.

Lawmakers have complained that the department knew about the shortfall for months, but did not alert them to the problem or a possible hospital shutdown until the last minute. “The possibility of a shutdown was never mentioned, even once, during a hearing that I called in late June, where VA first publicly admitted its budget troubles, or during any of the four times that Secretary [Bob] McDonald testified before Congress this year or anywhere in the quarterly financial plan that VA submitted in March, showing that VA was operating under budget so far this fiscal year,” said House Veterans’ Affairs Committee Chairman Jeff Miller, R-Fla., on the House floor Wednesday. “Once again, this Congress comes to rescue a mismanaged Department of Veterans Affairs.”

Senate Veterans’ Affairs Committee ranking member Richard Blumenthal, D-Conn., called the VA’s fiscal emergency “management malpractice.”

VA officials have said they did what Congress wanted them to do under the 2014 Veterans Access, Choice and Accountability Act, but simply needed the flexibility to shift existing money from one budget account to cover deficits in another.

Some House Democratic lawmakers expressed frustration over combining highway spending with veterans’ health care in one bill. Rep. Jared Polis, D-Colo., referred to the “grab-bag rule” that covered different bills on disparate subjects. The Democrat said he’d “never heard of a crazier name” than the Surface Transportation and the Veterans Health Care Choice Improvement Act.

“If you vote against this bill because you don’t like the transportation provisions, does that mean that you are against veterans? If you don’t like the veterans’ provisions, and you vote against this bill, does it mean you are against transportation?” he added.