A federal judge on Monday put a temporary halt to a Trump administration order denying the possibility of asylum to people who enter the US illegally.

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

Jon Tigar, a US District Judge in San Francisco, issued a temporary restraining order against the Trump proclamation, thus granting a request from human rights groups who had sued shortly after the order was announced.

Under the proclamation, Trump said only people who enter the US at official checkpoints - as opposed to sneaking across the border - can apply for asylum.

Judge Tigar wrote that the Immigration and Nationality Act of 1965 states that any foreigner who arrives in the US, "whether or not at a designated port of arrival," may apply for asylum.

"The rule barring asylum for immigrants who enter the country outside a port of entry irreconcilably conflicts with the INA and the expressed intent of Congress," Tigar wrote.