US President Donald Trump's third attempt to ban travel to the US from several countries has been blocked by a federal judge in Hawaii, just hours before the executive order was to go into full effect.

Judge Derrick Watson has found that Trump's order "plainly discriminates based on nationality" and fails to show that people coming from the listed countries would be" detrimental" to US national interests.

Tuesday's ruling came in response to a lawsuit by the Hawaiian state government, immigrant advocates and the American Civil Liberties Union (ACLU) against the renewed measure.

After earlier orders by Trump in January and March were at least partly blocked by legal challenges, the White House last month issued another version, imposing partial or full entry bans against people from seven countries, citing security risks where governments have failed to meet US demands for information sharing.

Chad, Iran, Libya, North Korea, Syria, Venezuela and Yemen were listed in the order issued on September 24.

The White House called the restrictions "tough but tailored".

Judge Watson's order marks the latest blow to Trump's long-running efforts to indefinitely restrict entry of travellers from targeted countries into the US.

The White House said the ruling is "dangerously flawed" and prevents the government from enacting "vital protections" to safeguard the US.

Sarah Sanders, a spokesperson, voiced confidence that the justice department would win the case despite the temporary restraining order.

Trump issued his proclamation only after an "extensive worldwide security review" by federal authorities, she said.

"These restrictions are vital to ensuring that foreign nations comply with the minimum security standards required for the integrity of our immigration system and the security of our nation," Sanders said.