San Francisco (CNN) The Trump administration's new effort to block some immigrants from seeking asylum in the United States faced its first test in court on Monday.

US District Judge Jon Tigar is weighing a request from immigrant rights groups to immediately block implementation of the administration's recent asylum rule while the legal battle plays out in court. Tigar heard arguments from both sides in a federal court in San Francisco on Monday, but did not issue a decision.

The administration's rule , issued earlier this month, bans most asylum claims from immigrants who crossed the US-Mexico border illegally.

Advocates argue it's illegal to block someone from seeking asylum based on how they entered the country, and that the administration also violated the Administrative Procedure Act by not providing public notice or comment on the rule.

Lee Gelernt, deputy director of ACLU's Immigrant Rights Project and the advocacy groups' lead attorney in the case, urged the judge to block the asylum restrictions. He argued that leaving them in place poses serious risks for vulnerable migrants who are seeking safety.

Read More