U.S. troops are sworn in as naturalized citizens on Nov. 2, 2012, at Bagram air base in Afghanistan. (State Department)

The defense authorization bill signed Tuesday by President Trump includes a measure to shield immigrant recruits from enlistment contract cancellations — and the specter of deportation — as they wait for drawn-out background checks to be completed, a positive development in the year-long effort by advocates and lawmakers to keep skilled noncitizens as a reliable recruiting pool.

The amendment, inserted by Sens. Kamala D. Harris (D-Calif.) and Richard J. Durbin (D-Ill.) into the $700 billion spending bill, allows Defense Secretary Jim Mattis to give active-duty immigrant recruits one additional year to wait for background checks to be finalized before they leave for basic training.

Previous rules allowed for two years of waiting time, but a host of time-consuming and complicated security measures introduced in September 2016 slowed the verification process so severely that the Pentagon shuttered the program last December under a logjam of background screenings and concerns over foreign infiltrators.

The result: Recruits waited so long that more than 1,000 identified by the Pentagon in June lost legal immigration status and came under threat of deportation. Others proactively sought asylum. One Iraqi national sought refuge in Canada to avoid deportation and capture by the Islamic State, and others from countries with weak rule of law, such as Russia and China, feared jail time if they were banished to their home nations and discovered to have enlisted in the U.S. military.

“This legislation will help ensure that they can continue to serve and not fall victim to a slow bureaucratic process. Immigrants have built this country, and these patriots represent the best of our nation,” Harris said in a release. While enlistment contracts alone do not shield recruits from deportation, it may provide the Department of Homeland Security a reason to defer removal action if a recruit falls out of status.

More than 10,400 foreign recruits have entered the military through the Military Accessions Vital to National Interest (MAVNI) program. The program trades fast-tracked citizenship to harness language skills and medical specialties — including surgical trades and fluency in languages such as Korean and Arabic — that the Pentagon determined were highly needed but rare among recruits willing to serve. The program was championed by Special Operations troops who operate in remote places where cultural and language expertise is especially prized.

But the two-year waiting window was too short, given the paralyzed bureaucracy of the Defense Department, said Margaret Stock, a retired Army officer and current immigration lawyer who led the design and implementation of MAVNI.

“The law is a promising sign and provides a temporary reprieve. At the same time, the recruits still face many obstacles,” Stock said, such as difficulty acquiring driver’s licenses and work as they wait for background checks to finish, and concerns about immigration authorities detaining them amid a robust deportation effort by the Trump administration.

Army recruiters nationwide, responding to messages in September about the two-year limit, erroneously canceled the contracts of probably hundreds of immigrants in a wave of misunderstood policy enforcement. Some of those cancellations were reversed after inquiries from The Washington Post.

But those who passed the two-year limit and saw their contracts revoked will not receive an additional year. Congressional Republicans watered down the bill to eliminate retroactive measures, said a Senate staffer with knowledge of the process.

“It’s a shame,” Stock said. “The U.S. has now lost the benefit of their service.”

More at Checkpoint:

Pentagon prepares to accept transgender recruits beginning in January, as Trump’s ban hangs in the balance

VA tried to reallocate $460 million earmarked for homeless veterans. Now it says that won’t happen.

There are four times as many U.S. troops in Syria as previously acknowledged by the Pentagon