The administration issued a rule earlier this month that temporarily required asylum seekers who cross the southern border to apply at U.S. ports of entry.

But the ACLU filed a lawsuit, arguing that the new rules violated the Immigration and Nationality Act. That law says people can apply for asylum regardless of how they enter the country.

The judge sided with the plaintiffs, writing in his order, "Whatever the scope of the President's authority, he may not rewrite the immigration laws to impose a condition that Congress has expressly forbidden."

The judge's temporary restraining order blocking the Trump administration's new policy will remain in effect until Dec. 19.

The White House didn't immediately comment on the ruling. It comes as thousands of Central American migrants have reached Tijuana, Mexico, which is across the border from San Diego, California. U.S. Customs and Border Protection agents already started processing some of their asylum claims, but are reportedly only accepting about 100 claims each day — so some migrants might be waiting in Tijuana for months.