Recruit Zhang, an immigrant from China, joined the United States military on the promise that enlisting would lead to American citizenship. He swore an oath to uphold the Constitution and was handed an Army T-shirt. But, after two years of delays, there came a sudden discharge that has left him reeling.

“They just said one word: I was ‘unsuitable,’” said the 30-year-old, who has a wife and child and a business management degree. He asked that only his last name be used. “I came here legally, made an agreement to stay legally, and they have not kept the agreement.”

A growing number of foreign-born recruits who joined the United States military through a special program created to recruit immigrant troops with valuable language and medical skills are being terminated before they can qualify for citizenship. Lawyers for the recruits say at least 30 have been discharged in recent weeks and thousands more are stuck in limbo — currently enlisted but unable to serve — and may also be forced out.

They are being cut even as the Army has been unable to meet its 2018 recruiting goals.

Mr. Zhang’s parents, a factory worker and a city official in southeast China, sold their house to support him while he waited two years to be called to boot camp. Now he may be deported, and worries he could be punished by the Chinese government for enlisting in a foreign army.