A federal judge in Hawaii has temporarily blocked the latest version of President Trump's travel ban.

The 40-page opinion issued by U.S. District Judge Derrick K. Watson came down Tuesday -- hours before the ban was set to go into effect early Wednesday morning. He found Trump's executive order "suffers from precisely the same maladies as its predecessor."

The judge, appointed by former President Barack Obama, said the new restrictions ignore a federal appeals court ruling that found President Donald Trump's previous ban exceeds the scope of his authority. The latest version "plainly discriminates based on nationality in the manner that the 9th Circuit has found antithetical to ... the founding principles of this nation," Watson wrote.

Get Breaking News Delivered to Your Inbox

Hawaii argued in court documents that the updated ban is a continuation of Trump's "promise to exclude Muslims from the United States" despite the addition of two non-majority Muslim countries.

The latest restrictions would have affected citizens of Chad, Iran, Libya, North Korea, Somalia, Syria, and Yemen -- and some Venezuelan government officials and their families. Unlike the first two ban attempts, which were also challenged in court, this ban has no expiration date.

This latest ban restricts people based on how well the U.S. believes those nations vet their travelers and provide sufficient identification.

Watson has blocked earlier versions of the administration's travel ban. This case will make its way through the federal courts system, but the administration has the best chance of succeeding with this ban, should it reach the U.S. Supreme Court, CBS News' Paula Reid reports. That's because the State Department and Department of Homeland Security worked with similar standards applied to all countries, and gave countries a time period to come into compliance with those standards.

The Justice Department intends to appeal the decision.

"Today's ruling is incorrect, fails to properly respect the separation of powers, and has the potential to cause serious negative consequences for our national security. The Department of Justice will appeal in an expeditious manner, continue to fight for the implementation of the President's order, and exercise our duties to protect the American people," said DOJ spokesman Ian D. Prior in a statement.

Acting DHS Secretary Elaine Duke said her team worked "tirelessly" on developing the restrictions.

"The men and women of the U.S. Department of Homeland Security worked tirelessly with our national security partners to develop baseline information sharing requirements to ensure that our vetting and screening procedures for foreign nationals ensure the safety of the American people from national security threats and public safety concerns. These requirements are essential to securing the homeland. While we will comply with any lawful judicial order, we look forward to prevailing in this matter upon appeal."

The White House called Tuesday's decision "dangerously flawed."

"Today's dangerously flawed district court order undercuts the president's efforts to keep the American people safe and enforce minimum security standards for entry into the United States," the White House said in a statement. "The Department of Justice will vigorously defend the president's lawful action. The proclamation restricting travel was issued after an extensive worldwide security review by the secretary of Homeland Security, and following consultation by the president with members of the Cabinet, including the secretaries of Homeland Security, State, and Defense and the attorney general."

"The entry restrictions in the proclamation apply to countries based on their inability or unwillingness to share critical information necessary to safely vet applications, as well as a threat assessment related to terrorism, instability, and other grave national security concerns," the statement continued. "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. 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."

The legal battle won't be over anytime soon.

The ACLU and other groups that have opposed earlier versions of the ban have also been fighting this one by asking to amend their existing lawsuit before a Maryland federal judge.

Washington state, Massachusetts, California, Oregon, New York and Maryland have challenged the policy before U.S. District Judge James Robart in Seattle, who struck down Mr. Trump's initial ban in January.

That policy led to chaos and confusion at airports nationwide and triggered several lawsuits, including one from Hawaii.

When the president revised the ban, state Attorney General Doug Chin changed the lawsuit to challenge that version. In March, Watson agreed with Hawaii that it amounted to discrimination based on nationality and religion.

A subsequent U.S. Supreme Court ruling allowed the administration to partially reinstate that 90-day ban on visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen and a 120-day ban on all refugees.

But it said the policy didn't apply to refugees and travelers with a "bona fide relationship" with a person or entity in the U.S.