SAN FRANCISCO - A U.S. judge on Monday temporarily blocked an order by President Donald Trump that barred asylum for immigrants who enter the country illegally from Mexico, the latest courtroom defeat for Trump on immigration policy.

U.S. District Judge Jon Tigar in San Francisco issued a temporary restraining order against the asylum rules. Tigar’s order takes effect immediately, applies nationwide, and lasts until at least Dec. 19 when the judge scheduled a hearing to consider a more long-lasting injunction.

Representatives for the U.S. Department of Justice could not immediately be reached for comment.

Trump cited an overwhelmed immigration system for his recent proclamation that officials will only process asylum claims for migrants who present themselves at an official entry point. Civil rights groups sued, arguing that Trump’s Nov. 9 order violated administrative and immigration law.

In his ruling, Tigar said Congress clearly mandated that immigrants can apply for asylum regardless of how they entered the country. The judge called the latest rules an “extreme departure” from prior practice.

“Whatever the scope of the President’s authority, he may not rewrite the immigration laws to impose a condition that Congress has expressly forbidden,” Tigar wrote.

Tigar was nominated to the court by President Barack Obama.

Slideshow ( 3 images )

Previous Trump immigration policies, including measures targeting sanctuary cities, have also been blocked by the courts.

The asylum ruling came as thousands of Central Americans, including a large number of children, are traveling in caravans toward the U.S. border to escape violence and poverty at home. Some have already arrived at Tijuana, a Mexican city on the border with California.

“IT IS TOO MUCH”

Rights groups have said immigrants are being forced to wait days or weeks at the border before they can present themselves for asylum, and the administration has been sued for deliberately slowing processing times at official ports.

At a hearing earlier on Monday, American Civil Liberties Union attorney Lee Gelernt said the order clearly conflicted with the Immigration and Nationality Act, which allows any person present in the United States to seek asylum, regardless of how they entered the country.

Gelernt said the ACLU had recently learned Mexican authorities have begun barring unaccompanied minors from applying at U.S. ports of entry.

Slideshow ( 3 images )

Mexico’s migration institute said in a statement to Reuters that there was “no basis” for the ACLU’s claims, noting that there had been no such reports from the United Nations or human rights groups that are monitoring the situation at the border.

Uriel Gonzalez, the head of a YMCA shelter for young migrants in Tijuana, said he had not heard of any new measures directed at unaccompanied minors. He noted there were already long lines to get a turn with U.S. authorities.

“This can take a while because the number of migrants has overwhelmed capacity. It is too much,” he said.

The judge on Monday wrote that Trump’s refugee rule would force people with legitimate asylum claims “to choose between violence at the border, violence at home, or giving up a pathway to refugee status.”

Caravan participants began to arrive last week in Tijuana on the Mexican side of the U.S. border, which has put a strain on shelters where many will wait to seek asylum. Their presence has also strained Tijuana’s reputation as a welcoming city, with some residents screaming at the migrants, “Get out!”

Trump sent more than 5,000 soldiers to the 2,000-mile (3,100 km) frontier with Mexico to harden the border, although critics dismissed the move as a political stunt ahead of congressional elections on Nov. 6.