LOS ANGELES — A federal judge on Wednesday ordered the Trump administration to continue accepting asylum claims from all eligible migrants arriving in the United States, temporarily thwarting the president’s latest attempt to stanch the flow of migrants crossing the southern border.

Judge Jon S. Tigar of the United States District Court in San Francisco issued a preliminary injunction against a new rule that would have effectively banned asylum claims in the United States for most Central American migrants, who have been arriving in record numbers this year. It would have also affected many migrants from Africa, Asia and other regions.

The decision came on the same day that a federal judge in Washington, hearing a separate challenge, let the new rule stand, briefly delivering the administration a win. But Judge Tigar’s order prevents the rule from being carried out until the legal issues can be debated more fully.

The rule, which has been applied on a limited basis in Texas, requires migrants to apply for and be denied asylum in the first safe country they arrive in on their way to the United States — in many of the current cases, Mexico — before applying for protections here. Because migrants from Honduras, El Salvador and Guatemala make up a vast majority of asylum seekers arriving at the southern border, the policy would virtually terminate asylum there.