A federal judge in Hawaii blocked President Donald Trump's latest bid to impose restrictions on citizens from eight countries entering the United States, which had been set to take effect this week.

The open-ended ban, announced last month, targeted people from Iran, Libya, Syria, Yemen, Somalia, Chad and North Korea, as well as certain government officials from Venezuela. It was the latest version of a policy that had previously targeted six Muslim-majority countries but had been restricted by the Supreme Court.

U.S. District Judge Derrick Watson on Tuesday granted Hawaii's request to temporarily block the federal government from enforcing the policy. It was supposed to take effect at midnight Wednesday.

Hawaii argues the updated ban is a continuation of Trump's "promise to exclude Muslims from the United States."

The state cited remarks the president made the day the executive order was signed in which he called for a tough "travel ban" as well as tweets posted to the president's Twitter account.

Trump tweet

The court also wrote that the ban likely runs afoul of the Immigration and Nationality Act's rule against discriminating against a particular nationality in issuing visas.

The latest ban "suffers from precisely the same maladies as its predecessor," Judge Watson wrote.

The White House said Tuesday's ruling was "dangerously flawed" and "undercuts the president's efforts to keep the American people 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," White House Press Secretary Sarah Huckabee Sanders said. "We are therefore confident that the judiciary will ultimately uphold the president's lawful and necessary action and swiftly restore its vital protections for the safety of the American people."

Hawaii Attorney General Doug Chin said the ruling Tuesday was a "victory for the rule of law."

New York Attorney General Eric T. Schneiderman said the administration's travel restriction "is still a Muslim Ban" by another name.

The latest nationwide ban is the president's third attempt to limit entry into the country. In September, the Supreme Court cancelled oral arguments in a case involving the second ban.

Other courts are weighing challenges to the policy. In Maryland, the American Civil Liberties Union and other groups are seeking to block the visa and entry restrictions in the president's latest proclamation.

"A federal court in Hawaii has temporarily blocked President Trump's newest Muslim ban," the ACLU said in a statement posted to its Twitter account. "We're glad but not surprised, to be honest."

ACLU tweet

Reuters and the Associated Press contributed to this story.