The American Civil Liberties Union, which brought the suit along with the Southern Poverty Law Center, and Center for Gender & Refugee Studies, said that despite the ruling, "there is good reason to believe that ultimately this policy will be put to a halt."
“Asylum seekers are being put at serious risk of harm every day that the forced return policy continues," Omar Jadwat, director of the ACLU’s Immigrants’ Rights Project, said in a statement. "Notably, two of the three judges that heard this request found that there are serious legal problems with what the government is doing."
The lawsuit on behalf of 11 asylum seekers from Central America and legal advocacy groups says the Trump administration is violating U.S. law by failing to adequately evaluate the dangers that migrants face in Mexico.
It also accuses Homeland Security and immigration officials of depriving migrants of their right to apply for asylum by making it difficult or impossible for them to do so.
The Trump administration says the policy responds to a crisis at the southern border that has overwhelmed the ability of immigration officials to detain migrants. Growing numbers of families are fleeing poverty and gang violence in Guatemala, Honduras and El Salvador.
Last year, the Justice Department eliminated gang violence and domestic abuse as a possible justification for seeking asylum.
The so-called "Remain in Mexico" policy was one of the primary innovations of former Homeland Security Secretary Kirstjen Nielsen, who left her role with the Trump administration last month.
Asylum law, conservatives point out, is intended to shield individuals from near-certain death or persecution on account of limited factors like religious or political affiliation — not poor living conditions and economic despair.
Most asylum applicants are ultimately rejected for having an insufficient or unfounded personalized fear of persecution, following a full hearing of their case before an asylum officer or an immigration judge.
Fox News' Raymond Bogan, Gregg Re and The Associated Press contributed to this report.