A United States judge on Monday temporarily blocked an order by President Donald Trump which barred asylum for immigrants who enter the country illegally from Mexico.

The latest courtroom defeat for Trump on immigration policy saw the San Francisco District Judge, Jon Tigar issuing a temporary restraining order against the asylum rules.

Tigar’s order, which takes effect immediately applies nationwide and is expected to last until at least December 19 when the judge has scheduled a hearing to consider a more long-lasting injunction.

Trump had cited an overwhelmed immigration system for his recent proclamation that officials would only process asylum claims for migrants who present themselves at an official entry point.

 Civil rights groups in the country had approached the court, arguing that Trump’s November 9 order violated the country’s administrative and immigration law.

In his ruling, Tigar described the latest rules as an ‘extreme departure’ from existing practices, adding that Congress clearly mandated that immigrants could apply for asylum regardless of how they entered the country.