(Reuters) - U.S. President Donald Trump’s unprecedented proposal to keep migrants waiting in Mexico while seeking U.S. asylum will likely face challenges that it endangers refugees and denies them due process, and may be decided by an obscure provision of U.S. immigration law.

U.S. President Donald Trump talks to reporters as he departs on travel to the G20 Summit in Argentina from the White House in Washington, U.S., November 29, 2018. REUTERS/Jonathan Ernst

Last week, Trump said that migrants who seek asylum at the U.S.-Mexican border would stay in Mexico until their claims were individually approved in U.S. courts, although Mexico’s incoming government denied they had struck any deal.

However, officials with the administration of Mexico’s President-elect Andres Manuel Lopez Obrador, who takes office on Saturday, have hinted that they may agree to a “Remain in Mexico” policy in the coming days when they meet with Trump officials.

The U.S. Department of Homeland Security did not respond to a request for comment about the proposal.

Keeping refugees in Mexico for the years it can take to resolve an asylum claim would be a stark break with long-standing practice, which allows asylum seekers to remain in the United States while their case plays out.

Legal experts said the proposal, if adopted, is expected to be challenged in court and could come down to the legality of a “contiguous territory” provision in U.S. immigration law. It allows for the return to Mexico of migrants who are in deportation proceedings while their asylum claim is reviewed.

The little-known provision has rarely if ever been used, in part because it would require a deal with Mexico to accept the migrants.

The Trump administration cited the provision in a February 2017 memo by then-secretary of DHS John Kelly. He directed his staff to set up a videoconferencing system and to establish facilities to allow migrants to participate in U.S.-based hearings from Mexico.

It is unclear if the work was finalized or even initiated, and DHS did not respond to questions.

Geoffrey Hoffman, the director of the University of Houston Law Center Immigration Clinic, wrote in a law review article this year he had found just one mention of the provision in a court ruling, in a 2011 case involving someone who was returned to Canada.

Hoffman said the provision could violate the basic premises of international and U.S. law regarding refugees - the concept of providing a safe haven to those fleeing persecution.

U.S. immigration law and international agreements, including a 1967 protocol on refugees and the 1984 Convention Against Torture, are built on the idea that refugees will not be sent against their will to a territory where their life or freedom is at risk.

To comply, the “Remain in Mexico” deal would have to protect asylum applicants from violence and provide basics such as housing and food while their cases play out, legal experts said.

Thousands of migrants are currently crammed into a filthy sports complex in Tijuana, in sight of the U.S. border, after traveling thousands of miles from Central America.

“Mexico and the United States will have to ensure the asylum seekers are not preyed upon by criminal gangs,” said Lee Gelernt, an attorney with the American Civil Liberties Union.

The administration has said in court filings in another asylum case that its existing policies protect claimants by discouraging perilous attempts to enter illegally along the rugged southern frontier, where hundreds of migrants die annually.

Earlier this month, a federal judge in San Francisco was unpersuaded. Judge Jon Tigar halted a policy that forced asylum seekers to apply at designated border crossings in part because refugees faced an “increased risk of violence” while waiting in Mexico for a chance to be processed.

The ruling enraged Trump, who said on Twitter the “Obama judge” made the United States less safe.

Legal experts said the ‘Remain in Mexico’ proposal may also violate U.S. constitutional guarantees of due process.

They said it would be a massive undertaking to establish a system in Mexico that would allow asylum seekers to remotely partake in U.S. proceedings without compromising their right to counsel and to present evidence and question witnesses.

“It’s horribly outrageous,” said Polly Webber, a former immigration judge, of the proposal. “It’s effectively depriving people of rights they should have under the Constitution.”

However, the Trump administration will likely argue the U.S. Constitution’s due process clause only applies in U.S. territory, according to Stephen Yale-Loehr, who teaches immigration law at Cornell Law School.

A federal judge in Brooklyn ruled in 1993 that President Bill Clinton’s administration violated the due process rights of HIV-positive Haitian refugees, who were eligible for U.S. asylum, even though they were not on U.S. soil. The refugees were detained at a U.S. military base in Cuba.