A federal judge has temporarily ordered immigration officials to stop re-detaining some Cambodian nationals in the U.S. with deportation orders without prior notice.

The temporary restraining order, granted Thursday by U.S. District Judge Cormac J. Carney, requires federal officials to give two-weeks written notice before they can re-detain the Cambodian nationals who have "received final orders of deportation or removal, and were subsequently released from ICE custody, and have not subsequently violated any criminal laws or conditions of their release, and have been or may be re-detained for removal by ICE."

Advocates say many of those nationals came to the U.S. in the 1970s as refugees fleeing the Khmer Rouge.

Lawyers for the nationals had written in court filings that they received “reliable information” that the government intended to “carry out large-scale raids and re-detain up to 100” starting in January.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

A lawyer for the petitioners called the order a “clear message” to Immigration and Customs Enforcement (ICE).

“The judge has recognized that ICE's campaign to arrest Cambodian refugees by ambush is likely illegal,” Jenny Zhao, a lawyer at Asian Americans Advancing Justice/Asian Law Caucus, told NBC News in an email. “At the very least, people are entitled to some warning so that they can look at their legal options and say goodbye to their families.”

ICE officials did not respond to a request for comment. An email from ICE said the agency’s spokespeople were out of office during the government shutdown and are prohibited by law from working.

More than 1,900 Cambodian nationals in the U.S. are subject to a final order of removal, about 1,400 of whom have criminal convictions and 500 of whom have no lawful status to remain in the country, ICE told NBC News in September 2017.

Community advocates have said that many of the Cambodian nationals deported arrived in the U.S. as children, served their time, and are the primary breadwinners in their families. The deportation order for one of the named petitioners in the lawsuit stems from charges brought in the ’90s.

In 1996, the Illegal Immigration Reform and Immigrant Responsibility Act expanded the definition of what types of crimes could result in deportation. It also allowed for that new definition to be applied retroactively, resulting in more than 16,000 Southeast Asian Americans, many of whom were refugees fleeing the Vietnam War and Cambodian genocide, receiving orders of removal — 78 percent of which were based on old criminal records, according to the advocacy group Southeast Asia Resource Action Center.

In 2002, the U.S. and Cambodia signed a repatriation agreement, opening the way for Cambodian nationals in the U.S. to be deported back to Cambodia. In a statement dated Sept. 14, 2017, Cambodia's Ministry of Foreign Affairs and International Cooperation said it had asked to renegotiate the countries' repatriation agreement in October 2016 after "fierce protests from Cambodian-American communities, Cambodians living in the country and some United States congressmen."

But Cambodian officials began interviewing nationals for deportation again after the U.S. temporarily stopped issuing visas to certain officials from the country.

“Many folks are still working on the process of healing from our immigration history and refugee history background, but also the compounded trauma of dealing with poverty, racism and a lot of different structural issues in our community,” Lian Cheun, the executive director of the California-based Khmer Girls in Action, told NBC News in 2017, when the lawsuit was first filed.

Carney ordered that the temporary restraining order will remain in effect until at least a scheduled Jan. 28 hearing to discuss whether or not a preliminary injunction preventing immigration officials from detaining Cambodian nationals without notice should be issued.

Follow NBC Asian America on Facebook, Twitter, Instagram and Tumblr.