Updated

The Senate gave final approval Thursday to sweeping legislation aimed at fixing the troubled Department of Veterans Affairs, marking a rare moment of bipartisan accord triggered by the widespread treatment delays veterans faced at agency facilities.

The legislation passed 91-3 a day after the House overwhelmingly approved the package. It now goes to President Obama’s desk.

The $17 billion measure is intended help veterans avoid long waits for health care, hire more doctors and nurses to treat them, and make it easier to fire senior executives at the Veterans Affairs Department.

The legislation comes months after the VA was rocked by reports of patients dying while awaiting treatment and mounting evidence that workers falsified or omitted appointment schedules to mask frequent, long delays.

The Senate earlier this week also confirmed former Procter & Gamble CEO Robert McDonald to lead the sprawling agency, which provides health care to nearly 9 million enrolled veterans and disability compensation to nearly 4 million veterans.

McDonald will replace Acting VA Secretary Sloan Gibson, who took over in May after Eric Shinseki resigned amid a growing uproar over the reports of long veterans' waits for health care. McDonald has pledged to transform the VA and promised that "systematic failures" must be addressed.

The measure approved Thursday includes $10 billion in emergency spending to help veterans who can't get prompt appointments with VA doctors to obtain outside care; $5 billion to hire doctors, nurses and other medical staff; and about $1.5 billion to lease 27 new clinics across the country.

The bill authors say the legislation will require about $12 billion in new spending after accounting for about $5 billion in unspecified spending cuts from the VA's budget.

The compromise measure would require the VA to pay private doctors to treat qualifying veterans who can't get prompt appointments at the VA's nearly 1,000 hospitals and outpatient clinics, or those who live at least 40 miles from one of them. Only veterans who are enrolled in VA care as of Aug. 1 or live at least 40 miles away would be eligible to get outside care.

The Associated Press contributed to this report.