Ana Maria, from El Salvador, carries her one-year-old son Mateo as they walk through a field with other asylum-seeking migrants from Central America after they illegally crossed the Rio Grande river into the U.S. from Mexico, in Penitas, Texas, March 31, 2019.

A U.S. judge on Monday blocked the Trump administration's policy of returning asylum seekers to Mexico as they wait for an immigration court to hear their cases but the order won't immediately go into effect.

Judge Richard Seeborg in San Francisco granted a request by civil liberties groups to halt the practice while their lawsuit moves forward. He put the decision on hold until Friday to give U.S. officials the chance to appeal.

The launch of the policy in January in San Diego at the nation's busiest border crossing marked an unprecedented change to the U.S. asylum system, government officials and asylum experts said. Families seeking asylum typically had been released in the U.S. with notices to appear in court.

President Donald Trump's 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.

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.

Under the new policy, asylum seekers are not guaranteed interpreters or lawyers and don't get to argue to a judge that they face the potential of persecution or torture if they are sent back to Mexico, Judy Rabinovitz, an attorney for the American Civil Liberties Union, said at a March court hearing.

Seeborg appeared skeptical of the lawsuit's argument that the administration misapplied a U.S. law that allows the return of immigrants to Mexico. The ACLU and other groups that are suing say that law does not apply to asylum seekers who cross the border illegally or arrive at a border crossing without proper documents.

The judge also questioned the Justice Department's argument that asylum seekers sent back to Mexico are not eligible for certain protections, such as a hearing before an immigration judge.

The administration hopes that making asylum seekers wait in Mexico will discourage weak claims and help reduce an immigration court backlog of more than 800,000 cases.

Justice Department attorney Scott Stewart said there is a process to protect immigrants who could face harm in Mexico. All 11 plaintiffs in the lawsuit are represented by attorneys, and 10 already have appeared for court proceedings, he said.

Border Patrol arrests, the most widely used gauge of illegal crossings, have risen sharply over the last year but are relatively low in historical terms after hitting a 46-year low in 2017.

The launch of the policy followed months of delicate talks between the U.S. and Mexico. Mexicans and children traveling alone are exempt from it.