WASHINGTON (Reuters) - An extra 2,500 visas for Afghans who assisted American forces during the war in their country will be granted under the $1 trillion U.S. government funding deal reached on Sunday, preserving a program that had been at risk of shutting down.

U.S. Marines prepare to board a plane at the end of operations for U.S. Marines and British combat troops in Helmand October 26, 2014. REUTERS/Omar Sobhani

The spending deal agreed by congressional negotiators continued the Afghan Special Immigrant Visa (SIV) program, which allows Afghans who worked for the U.S. government, often risking their lives, to move to the United States after a rigorous vetting process.

A recent bi-partisan push by U.S. lawmakers for more SIV visas came against the backdrop of efforts by President Donald Trump’s administration to clamp down on immigration from majority Muslim countries, an effort that has been blocked by the courts.

In March, the U.S. embassy in Kabul said it had stopped scheduling interviews for SIV applicants because it had nearly run out of visas, even though 1,500 more were included in the National Defense Authorization Act passed in late 2016.

That helped prompt a group of senators, including Republican Armed Services Committee Chairman John McCain to seek more.

As of April 20, only 780 SIV visas remained available, while more than 14,000 Afghans had already begun the application progress, according to the U.S. State Department.

Democratic Senator Jeanne Shaheen, a long-time advocate for the SIV program, said letting it lapse would have sent a message that the United States was willing to abandon its supporters.

“It’s both a moral and practical imperative that Congress approve additional visas. Thousands of Afghans have put themselves, and their families, at risk to help our soldiers and diplomats accomplish the U.S. mission and return home safely,” Shaheen said in an emailed statement.

Afghanistan is not one of the six countries whose citizens would have been barred under Trump’s executive order, but some of the president’s fellow Republicans in Congress have resisted expanding the SIV program out of concern that militants could use it to enter the United States.

Supporters of the program say such concerns are overblown, noting the intensity of the screening to which applicants are subjected.