HONOLULU (AP) - A federal judge blocked President Donald Trump's revised travel ban hours before it was to take effect, marking the second time courts have thwarted Trump's efforts to freeze immigration by refugees and citizens of some predominantly Muslim nations.

This time, the ruling came from a judge in Hawaii who rejected the government's claims that the travel ban is about national security, not discrimination. U.S. District Judge Derrick Watson also said Hawaii would suffer financially if the executive order constricted the flow of students and tourists to the state, and that Hawaii was likely to succeed on a claim that the ban violates First Amendment protections against religious discrimination.

Watson criticized what he called the "illogic" of the government's arguments and cited "significant and unrebutted evidence of religious animus" behind the travel ban. He also noted that while courts should not examine the "veiled psyche" and "secret motives" of government decision-makers, "the remarkable facts at issue here require no such impermissible inquiry."

"For instance, there is nothing 'veiled' about this press release: 'Donald J. Trump is calling for a total and complete shutdown of Muslims entering the United States,'" Watson wrote, referring to a statement Trump issued as a candidate.

Trump called the ruling an example of "unprecedented judicial overreach" and said his administration would appeal it to the U.S. Supreme Court. He also called his new travel ban a watered-down version of the first one, which he said he wished he could implement.

"We're going to win. We're going to keep our citizens safe," the president said at a rally in Nashville. "The danger is clear. The law is clear. The need for my executive order is clear."

If the administration seeks an emergency stay of Watson's decision at the 9th Circuit, the matter would be heard by different judges from the three who ruled on the case last month. That's because the panel of judges assigned to such cases rotates every month, said court spokesman David Madden.

The 9th Circuit on Wednesday declined to reconsider the 3-0 decision not to reinstate the original ban. In a dissent, five judges said they considered that decision incorrect and wanted it vacated.

"Whatever we, as individuals, may feel about the president or the executive order, the president's decision was well within the powers of the presidency," Judge Jay Bybee wrote for the five.

Watson issued his 43-page ruling less than two hours after hearing Hawaii's request for a temporary restraining order to stop the ban from being put into practice.

The hearing was one of three held Wednesday in federal courts around the country. U.S. District Judge James Robart in Seattle, who blocked the initial travel ban last month, did not immediately rule on a request from an immigrant-rights group to block the revised version. Neither was there a ruling from U.S. District Judge Theodore Chuang in Maryland in a challenge brought by the American Civil Liberties Union and other groups.

In all, more than half a dozen states are trying to stop the ban. A case brought by Washington state argues that the new order harms residents, universities and businesses, especially tech companies such as Washington state-based Microsoft and Amazon, which rely on foreign workers. California, Maryland, Massachusetts, New York and Oregon have joined the claim.

Trump's initial travel ban, issued on a Friday in late January, brought chaos and protests to airports around the country as travelers from seven nations - Somalia, Iran, Iraq, Syria, Sudan, Libya and Yemen - were barred from entering even if they had prior permission to come to the U.S. The State Department canceled up to 60,000 visas, but later reversed that decision.

Robart ordered the government to stop enforcing the ban, which also suspended the nation's acceptance of refugees from around the world, and a three-judge panel from the 9th U.S. Circuit Court of Appeals unanimously declined to reinstate the ban.

The administration subsequently rewrote the ban, emphasizing more of a national security rationale, dropping Iraq from the list of banned countries and spelling out some reasons that travelers from the listed nations might be granted waivers allowing them into the U.S. despite the policy. The new ban does not apply to travelers who already have visas.

Critics of the ban said the changes made it more palatable, but they still argued that it violated both the Constitution and federal immigration law, and they tweaked their lawsuits to target the revised order.

Watson is a 2012 appointee of President Barack Obama. He is the only Native Hawaiian currently sitting as a federal judge and the fourth in U.S. history. He received his law degree from Harvard in 1991.

In his order, he found little evidence the travel ban would aid national security, noting a point brought up by the state: that a draft report from the Department of Homeland Security found nationality to be an "unlikely indicator" of terrorism threats.

Watson made it clear that his decision applied nationwide, ruling that the ban could not be enforced at any U.S. borders or ports of entry or in the issuance of visas.

In the Hawaii case, the federal government said there was no need to issue an emergency restraining order because Hawaii officials offered only "generalized allegations" of harm.

Washington Attorney General Bob Ferguson, who filed the lawsuit that succeeded in blocking the first ban, cheered the Hawaii judge's ruling.

"It's very exciting," Ferguson said. "At this point it's a team effort - multiple lawsuits and multiple states."

___

Johnson reported from Seattle. Associated Press Writer Ben Nuckols in Greenbelt, Maryland, and Sudhin Thanawala in San Francisco also contributed to this report.