A federal judge in Hawaii issued a nationwide temporary restraining order on President Trump’s revised travel ban, just hours before the executive order was set to take effect.

The ruling by U.S. District Judge Derrick Watson came after the White House spent weeks revising its travel ban to withstand legal scrutiny. The revised order, which was due to take effect today, would have banned travelers from six mostly-Muslim nations from entering the U.S. for 90 days and suspended all refugee admissions for 120 days. The new ban excluded Iraq, whose government has pledged increased information sharing with the U.S. when it comes to vetting its citizens applying for a visa to travel to the U.S. The other six countries listed in the original order would remain banned: Iran, Libya, Somalia, Sudan, Syria and Yemen. The new order also exempted current visa holders and legal permanent residents of the U.S., and did not include any explicit exceptions for religious minorities in the countries identified in the travel ban.

Those changes did not persuade Watson that the ban wouldn’t discriminate against Muslims. Watson said that “a reasonable, objective observer – enlightened by the specific historical context, contemporaneous public statements, and specific sequence of events leading to [the ban’s] issuance – would conclude that the executive order was issued with a purpose to disfavor a particular religion.”

Watson went on to say that Trump made statements as a candidate that he would enact a Muslim ban. “These plainly-worded statements, made in the months leading up to and contemporaneous with the signing of the Executive Order, and in many cases made by the Executive himself, betray the Executive Order’s stated secular purpose,” Watson said.

President Trump’s earlier attempt to institute a more expansive travel ban was blocked by a federal judge in Washington state in late January, leading the administration to rewrite the executive order.

Trump, speaking at a rally in Nashville last night, called the Hawaii court ruling “terrible” and “sad,” and vowed to fight the case “as far as it needs to go.”

The Justice Department also issued a statement saying it “strongly disagrees with the federal district court’s ruling, which is flawed both in reasoning and in scope. The President’s Executive Order falls squarely within his lawful authority in seeking to protect our nation’s security, and the Department will continue to defend this Executive Order in the courts.”