U.S. Army soldiers raise their right hands as they take the oath of citizenship during a ceremony at the al-Faw palace in Baghdad in 2008. More than 200 service members received their U.S. citizenship that day in a program the military is now cracking down on. (Petros Giannakouris/AP)

Last month, reports emerged that the U.S. military had begun discharging immigrant Army reservists and recruits who did not pass their security screening and were deemed “unsuitable.” For many, it closed off their pathway to obtaining U.S. citizenship through the military.

This action reflects the latest in the Trump administration’s organized assault on immigrants, but it’s also part of a far longer story. Over the past 70 years of unending U.S. wars, the military has repeatedly welcomed immigrants and those deemed “foreign” for their skills and symbolic value, and then subsequently discharged them on the grounds that they posed a threat to the nation. Doing so reflects an America caught between military necessity and suspicion of others, driven by racism, that has made appeals for immigrant inclusion and support for U.S. overseas militarism increasingly difficult to separate.

During World War II, hundreds of Japanese Americans were recruited into the military from internment camps. Many served in the segregated 442nd Regimental Combat Team. Those skilled in the Japanese language joined the Military Intelligence Service to gather and analyze enemy intelligence.

Beyond their language skills and manpower, Japanese Americans also offered great symbolic value for the military by countering Japanese propaganda about American racism. At a time when nearly 120,000 Japanese residents in the United States were imprisoned in camps and had their constitutional rights suspended because they were deemed “enemy aliens,” these exceptional Japanese American soldiers told a story of redemption and American progress. President Harry S. Truman commended them in 1946: “You fought not only the enemy, but you fought prejudice — and you have won.”

And yet, even as symbols of American enlightenment and indispensable cogs in the war machine, many Japanese American service members faced intense scrutiny because of suspicions about their potential for disloyalty. After the war, the Army ordered “all inductees or enlistees of Japanese ancestry” to Occupied Japan to serve as translators and “ambassadors of democracy.” At the same time, the Army’s Office of Intelligence (G-2) monitored them for potential subversion, and Japanese American service members believed to have ties with Japanese communists were discharged.

Once the Korean War broke out, Korean Americans stationed in South Korea were similarly interrogated over their political affiliations and potential ties to Communist North Korea.

Even as these Americans served their country with distinction, they were treated as foreigners whose presence in the military only further amplified the threat that they posed to national security. They were seen as racial minorities first and soldiers second, and notwithstanding their donning of the military uniform, their loyalty to the nation was rendered inherently suspect by their race. In some cases, Army intelligence officers even believed that their “racial background” made them susceptible to communist propaganda.

This ambivalence toward nonwhite American soldiers extended to soldiers from allied countries. During the Cold War, the Defense Department created the Mutual Defense Assistance Program to train soldiers from allied countries, including South Korea, Taiwan, the Philippines and South Vietnam. The program brought over 140,000 foreign military trainees to the United States throughout the 1950s.

Like the Japanese Americans in the military during World War II, the Defense Department saw these trainees as vital manpower for the defense of the “free world” from Communism as well as cultural ambassadors who could spread the gospel of American democracy back in their home countries. To enhance what they termed the “collateral benefits” of the trainees, the Defense Department even published guidebooks to acquaint them with the “American way of life” premised on ideals of freedom and individualism.

Despite being allies, these foreign trainees were not immune from the anti-communist hysteria then sweeping the United States. Immigrant communities in particular fell prey to witch hunts in this environment. And when some foreign trainees went AWOL and sought asylum in the United States from U.S.-backed anti-communist regimes in their home countries, they quickly went from being perceived as military assets to being viewed as an immigration problem and national security threat. Instead of being granted asylum, many of them were subjected to deportation.

The pattern of welcoming foreign nationals into the military and then discharging or criminalizing them has continued to the present. In 2009, the Military Accessions Vital to the National Interest, or MAVNI, program was established to enlist non-U.S. citizens through the promise of expedited citizenship. The MAVNI program prioritized enlistees with “critical skills” such as “physicians, nurses, and certain experts in language with associated cultural background.” It was part of the revival of counterinsurgency championed by senior military officials in the War on Terror.

Despite its promised military benefits, the specter of “foreigners within” plagued the program almost from its start. In 2009, MAVNI was suspended temporarily after the mass shooting at Fort Hood, Tex., by U.S.-born Army Maj. Nidal Malik Hasan. The program was reinstated in 2012 after the implementation of tighter screening procedures.

With the recent wave of discharges of MAVNI recruits, however, we are seeing echoes of the past. Some of the recruits have been discharged because of their “foreign ties” of their relatives living abroad.

There has been a persistent contradiction between the imperatives of fighting U.S. wars abroad — in which immigrants and those perceived to be foreign because of their race are valued for their skills and symbolic value — and the ongoing war at home against immigrants and racial minorities who are deemed a threat to America’s imagined homogenous culture. Discharging “bad” immigrants from the military has been a way of resolving this contradiction. It preserves the military’s image as an inclusive and diverse institution and reinforces the false idea that there are “deserving” immigrants. At the same time, however, it nurtures suspicions about racial minorities, immigrants and foreigners.

As this history reveals, the struggle for justice on behalf of those who have been discharged from the military must be waged as part of the struggle against this administration’s anti-immigrant policies, and that struggle must be a part of the broader fight to end America’s permanent war at home and abroad. So long as the United States remains engaged in almost perpetual war, there will be a need for nonwhite soldiers with cultural and symbolic value and simultaneously intense suspicion of them. Xenophobia and militarism have always fueled one another, and ending one requires ending the other.