BEDMINSTER, N.J. (AP) — President Donald Trump has signed an emergency spending bill that will pump more than $2 billion into a program that allows veterans to receive private medical care at government expense.

Trump, who made improving veterans care a central campaign promise, signed the VA Choice and Quality Employment Act while at his New Jersey golf club on Saturday. The bill, which addresses a budget shortfall at the Department of Veteran Affairs that threatened medical care for thousands of veterans, provides $2.1 billion to continue funding the Veterans Choice Program, which allows veterans to seek private care.

Another $1.8 billion will go to core VA health programs, including 28 leases for new VA medical facilities.

“Today is another milestone in our work to transform the VA where we’re doing record-setting business,” Trump said.

The Choice program was put in place after a 2014 wait-time scandal that was discovered at the Phoenix VA hospital and spread throughout the country. Veterans waited weeks or months for appointments while phony records covered up the lengthy waits.

The program allows veterans to receive care from outside doctors if they must wait at least 30 days for an appointment or drive more than 40 miles to a VA facility. VA Secretary David Shulkin has warned that without legislative action, the Choice program would run out of money by mid-August, causing delays in health care for thousands of veterans.

The bill will extend the program for six months. Costs will be paid for by trimming pensions for some Medicaid-eligible veterans and collecting fees for housing loans.

Veterans groups applauded the bill being signed, though some criticized the delay and the cost.

“We’re grateful President Trump is taking decisive action to ensure veterans using the Choice Program won’t see lapses in their care due to a lack of funding,” said Dan Caldwell, policy director for Concerned Veterans for America. “Unfortunately, this bill took far too long to get to the president’s desk and is $1.8 billion more expensive than it needed to be.”

Leaders of the House Veterans Affairs Committee said the six-month funding plan was urgently needed and would give Congress more time to debate broader issues over the VA’s future. While the bill may avert a shutdown to Choice, disputes over funding may signal bigger political fights to come.

During the 2016 campaign, Trump criticized the VA for long wait times and mismanagement, saying he would give veterans more options in seeing outside providers. Shulkin announced the budget shortfall last month, citing unexpected demand from veterans for private care and poor budget planning. To slow spending, the department last month instructed VA medical centers to limit the number of veterans it sent to private doctors.

Currently, more than 30 percent of VA appointments are in the private sector, up from fewer than 20 percent in 2014. The VA has an annual budget of about $180 billion.