Image copyright Reuters Image caption A woman (middle) travelling from Jordan on a Yemeni passport arrives in Los Angeles, California

US President Donald Trump's latest bid to impose travel restrictions on citizens from eight countries entering the US has suffered a court defeat.

A federal judge slapped a temporary restraining order on the open-ended ban before it could take effect this week.

The policy targets Iran, Libya, Syria, Yemen, Somalia, Chad and North Korea, as well as some Venezuelan officials.

Previous iterations of the ban targeted six Muslim-majority countries, and were widely referred to as a "Muslim ban".

The state of Hawaii sued in Honolulu to block Mr Trump's third version, which was set to go into effect early on Wednesday.

Hawaii argued in court documents that the revised policy was fulfilling Mr Trump's campaign promise for "a total and complete shutdown of Muslims entering the United States", despite the addition of North Korea and Venezuela.

Media playback is unsupported on your device Media caption Muslim students on Trump ban: 'I don't belong here'

It also argued the president did not have the powers under federal immigration law to impose such restrictions.

US District Judge Derrick Watson, who blocked Mr Trump's last travel ban in March, issued the new restraining order.

The president's controversial travel bans have each been frustrated by the courts to some degree:

In January, the president signed an order banning people from seven Muslim-majority countries and suspending all refugee entry. The measure prompted protests and legal challenges across dozens of states

A revised version exempted green card holders and dual citizens. By June, the Supreme Court allowed most of it to go into effect - but granted a wide exemption for those with a "bona fide connection" to the US

That was replaced by Mr Trump's latest order, announced in late September, which changed the criteria and added non-Muslim-majority nations North Korea and Venezuela.

In Hawaii, Judge Watson decided that the new policy "suffers from precisely the same maladies as its predecessor".

He said "it lacks sufficient findings that the entry of more than 150 million nationals from six [of the] specified countries would be 'detrimental to the interests of the United States'".

His decision temporarily blocks the ban on all targeted countries except North Korea and Venezuela.

The ban is also facing court challenges from Maryland, Washington state, Massachusetts, California, Oregon and New York.

White House Press Secretary Sarah Huckabee Sanders said in a statement the latest court order was "dangerously flawed" and "undercuts" efforts to keep Americans safe.

"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," she said.

She said the White House was confident the president's "lawful and necessary action" would eventually be upheld by the courts.

As it stands, the Supreme Court has delayed its consideration of the case from October, asking all parties to resubmit briefs to the court accounting for the changes made between the second and third versions of the order.