HO CHI MINH CITY, Vietnam — The Trump administration has quietly backed away from its determination to deport certain Vietnamese immigrants who have been in the United States for years, a policy that had put the United States at odds with Vietnam and led to the resignation of the American ambassador there last year.

The shift, detailed in a California district court ruling on Oct. 18 and confirmed by an official in the Department of Homeland Security, comes as the White House has put harsh limits on immigration and asylum at the center of its public policy.

Last year, the administration began rounding up long-term immigrants from Vietnam, Cambodia and other countries and preparing to deport them. Some of the targeted immigrants had green cards but had not been naturalized as citizens, and the vast majority of them had at some point committed crimes — roughly 7,700 of the 8,000 or so of the Vietnamese immigrants who were classified as deportable, according to the Department of Homeland Security.

But specifically in Vietnam’s case, that country and the United States had signed an agreement in 2008 that Vietnamese who had arrived before July 12, 1995 — the date the formerly warring countries re-established diplomatic relations — could not be deported. Most of those immigrants had come to the United States as a result of the Vietnam War.