A federal judge has put a temporary halt to the Trump administration’s new order denying the possibility of asylum to people who enter the US illegally.

President Donald Trump issued the proclamation earlier this month as a matter of what he called national security as a US-bound caravan of Central American migrants made its way through Mexico toward the US border.

US District Judge Jon Tigar on Monday in San Francisco issued a temporary restraining order against the Trump order.

The request was made by the American Civil Liberties Union and the Center for Constitutional Rights, which quickly sued after Trump issued the ban this month.

The United States had earlier this month embarked on a policy of automatically rejecting asylum claims of people who cross the Mexican border illegally in a bid to deter Central American migrants and force Mexico to handle them.

President Donald Trump signed an executive order aimed at halting the flow of migrants seeking to cross into the United States without papers, most of them requesting asylum due to violence in their home countries.

“The continuing and threatened mass migration of aliens with no basis for admission into the United States through our southern border has precipitated a crisis and undermines the integrity of our borders,” Trump said in the order.

Trump used his emergency powers for the order, which critics said violates international law protecting asylum seekers.

But US officials said that as Mexico is the first safe country US-bound migrants from Guatemala, El Salvador and Honduras arrive in, the asylum claims should be presented there.

Trump’s order was explicit in wanting Mexico to deal with the problem. It said the automatic denial of asylum claims to illegal border-crossers would continue for 90 days or until there is an agreement which “permits the United States to remove aliens to Mexico.”

The United States regularly sends Mexican undocumented entrants back across the border to their country but has had difficulties gaining cooperation to repatriate Hondurans, Salvadorans and Guatemalans.

The US order said asylum requests will continue to be accepted from migrants who seek to cross at official US ports of entry.

But directing the migrants to the official ports could create massive backups among applicants on the Mexican side of the border.

US officials indicated that they had no plans to expand staffing of asylum claim facilities at the ports.

They said staff already had other duties processing legal travellers, inspecting cargoes and policing for drugs.