A federal judge in Hawaii has blocked President Trump’s revised travel ban – just hours before it was expected to go into effect across the United States.

The Hawaiian judge (a personal friend of Obama) might have issued the order, but the drive to stop President Trump’s travel and refugee temporary immigration hiatus comes from Egyptian imam Ismail Elshikh. Judge Watson, who was a Harvard law classmate of Barack Obama’s, issued an injunction halting Trump’s executive order from going into effect, agreeing with Hawaii’s claim that the temporary ban, 90 days on visa travelers and 120 days for refugees, would irreparably harm the state’s tourism industry and its Muslim families.

Tuesday’s decision from U.S. District Judge Derrick Watson in Honolulu stops the administration’s third attempt to indefinitely ban entry into the country by most nationals of Libya, Syria, Iran, Yemen, Somalia, Chad and North Korea. The ban would also prevent some Venezuelan government officials and their families, Fox News reports.

“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.”

Watson, who was appointed by former President Barack Obama, found Trump’s executive order “suffers from precisely the same maladies as its predecessor.”

The judge said the new restrictions ignore a federal appeals court ruling that found 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.

The government has said the new policy was based on an objective assessment of each country’s security situation and willingness to share information with the U.S.

A 1952 federal law — the Immigration and Nationality Act, passed in the midst of a Cold War fear over Communist influence — historically gives the chief executive broad authority.

“Whenever the president finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, he may, may by proclamation, and for such period as he shall deem necessary,” Section 212 (f) of the law states, “suspend the entry of all aliens or any class of aliens as immigrants or non-immigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate.”

The court’s decision means the justices will now wade into the biggest legal controversy of the Trump administration — the president’s order temporarily restricting travel, which even Trump has termed a “travel ban.” The court made clear that a limited version of the policy can be enforced for now, Fox News reports.

“An American individual or entity that has a bona fide relationship with a particular person seeking to enter the country as a refugee can legitimately claim concrete hardship if that person is excluded,” the court wrote. “As to these individuals and entities, we do not disturb the injunction. But when it comes to refugees who lack any such connection to the United States, for the reasons we have set out, the balance tips in favor of the Government’s compelling need to provide for the Nation’s security.”

The justices will review the broader constitutional issues over executive authority on immigration with oral arguments to be held in the fall.

“The Government has made a strong showing that it is likely to succeed on the merits – that is, that the judgments below will be reversed,” wrote Justice Thomas, supported by Alito and Gorsuch. “The Government has also established that failure to stay the injunctions will cause irreparable harm by interfering with its ‘compelling need to provide for the Nation’s security.’”

At issue is whether the temporary ban violates the Religion Clauses of the First Amendment, the Due Process Clause of the Fifth and 14th Amendments, and the ban on nationality discrimination in the issuance of immigrant visas contained in a 65-year-old congressional law.

In his opinion, Thomas criticized the majority for the compromise nature of Monday’s ruling, indicating he would have allowed the order to be enforced in full. Thomas said he feared “the Court’s remedy” would inspire a flood of new litigation.

“Today’s compromise will burden executive officials with the task of deciding — on peril of contempt — whether individuals from the six affected nations who wish to enter the United States have a sufficient connection to a person or entity in this country,” Thomas wrote. “The compromise also will invite a flood of litigation until this case is finally resolved on the merits, as parties and courts struggle to determine what exactly constitutes a ‘bona fide relationship,’ who precisely has a ‘credible claim’ to that relationship, and whether the claimed relationship was formed ‘simply to avoid §2(c)’ of Executive Order No. 13780.”

But as we just found out today, 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.

Other courts are weighing challenges to the latest travel restrictions.

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.

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 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 Trump 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.

Hawaii then successfully challenged the federal government’s definition of which family members would be allowed into the country. Watson ordered the government not to enforce the ban on close relatives such as grandparents, grandchildren, uncles and aunts.

The judge’s order Tuesday prevents acting Homeland Security Secretary Elaine Duke and Secretary of State Rex Tillerson from implementing the latest travel ban.

Watson said he would set an expedited hearing to determine whether the temporary restraining order should be extended.