A federal judge has blocked Donald Trump’s latest attempt to bar travelers from several countries, almost all of them predominantly Muslim, from entering the US.

Judge Derrick Watson of Hawaii’s Federal District Court issued a nationwide order, hours before the third version of the “Muslim Ban” was to take effect.

Trump tried to halt travel to the US by citizens of seven mainly-Muslim countries in late January, causing chaos at airports amid sudden implementation of the ban. After Watson and other judges ruled the measures unconstitutional, the Administration issued a revised order in March for six countries.

That version was limited by judicial rulings and due for review by the Supreme Court this autumn when Trump issued the third order in September. Scheduled to begin on Wednesday, it went even further than the original, imposing permanent restrictions on travel instead of the original 90-day suspensions, on many citizens of Iran, Libya, Syria, Yemen, Somalia, Chad, and North Korea as well as certain Venezuelan government officials and their families. Iraqi citizens of Iraq faced extra barriers to entry.

Judge Watson wrote on Tuesday that the new order “suffers from precisely the same maladies as its predecessor”, as it “plainly discriminates based on nationality” in a way that undercut “the founding principles of this Nation”. He reiterated that the Administration had not shown a national security interest.

Watson blocked any barrier to entry for those from Chad, Iran, Libya, Syria, Yemen, and Somalia. He did not prevent the Administration from barring North Koreans or Venezuelans or from subjecting Iraqis to stricter scrutiny.

The White House responded that the ban is “lawful and necessary”:

[This] undercuts the President’s efforts to keep the American people safe and enforce minimum security standards for entry into the United States. 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.>