GREENBELT, Md. — Rejecting arguments from the government that President Donald Trump's revised travel ban was substantially different from the first one, judges in Hawaii and Maryland blocked the executive order from taking effect as scheduled on Thursday, using the president's own words as evidence that the order discriminates against Muslims.

The rulings in Hawaii late Wednesday and in Maryland early Thursday were victories for civil liberties groups and advocates for immigrants and refugees, who argued that a temporary ban on travel from six predominantly Muslim countries violated the First Amendment. The Trump administration argued that the ban was intended to protect the United States from terrorism.

In Greenbelt, Maryland, U.S. District Judge Theodore Chuang — who was appointed by then-president Barack Obama — called Trump's own statements about barring Muslims from entering the United States "highly relevant." The second executive order removed a preference for religious minorities from the affected countries, among other changes that the Justice Department argued would address the legal concerns surrounding the first ban, which was also blocked in court.

"Despite these changes, the history of public statements continues to provide a convincing case that the purpose of the Second Executive Order remains the realization of the long-envisioned Muslim ban," Chuang said.

The initial ban sparked chaos at U.S. airports and widespread criticism around the world when it was signed in January. It was later blocked by a judge in Washington state, a ruling that was upheld by the 9th U.S. Circuit Court of Appeals.

In Honolulu, U.S. District Judge Derrick 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."

Watson also wrote, referring to a statement Trump issued as a candidate, "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.'"

The White House and the Justice Department had no immediate comment on Thursday. The case was argued in court by acting U.S. Solicitor General Jeffrey Wall, who said the ban "doesn't say anything about religion. It doesn't draw any religious distinctions."

Speaking Wednesday evening at a rally in Nashville, Tennessee, Trump called the ruling in Hawaii 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. "The danger is clear. The law is clear. The need for my executive order is clear."

While the Hawaii order only halts the ban temporarily, Chuang's ruling in Maryland took the form of a preliminary injunction, which will remain in effect indefinitely as the case is litigated. Chuang was also the first judge to stop the ban outside the 9th Circuit, which has a liberal reputation.

"Unless and until the president realizes that this is a battle in which he's going to keep losing and decides to do the right thing and abandon this course, for as long as he's on it we'll keep litigating it and I think we're going to keep winning," said Omar Jadwat, who argued the case for the American Civil Liberties Union in Maryland.

Chuang did not block the entire executive order, saying the plaintiffs didn't sufficiently develop their argument that a temporary ban on refugees discriminates on the basis or religion. Plaintiffs in the Maryland case also had sought to stop a portion of the order that would reduce the number of refugees allowed to enter the country this fiscal year from 110,000 to 50,000.

Still, the judge's order is hugely meaningful for many plaintiffs, including a man in Texas whose same-sex fiancé is seeking a visa to enter the United States from Iran, said Justin Cox, an attorney with the National Immigration Law Center who also argued the Maryland case.

"This Muslim ban was threatening to either separate or continue to separate families who've already been separated for months and years," Cox said. "It has real-world consequences and we were obviously very glad to see that Judge Chuang recognized those and rejected the government's frankly callous argument that our clients have already been waiting and another few months couldn't possibly be irreparable."

If the administration appeals Watson's decision at the 9th Circuit level, 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.

The hearings in Maryland and Hawaii were two 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.

In all, more than half a dozen states are trying to stop the ban.

___

Associated Press writers Sarah Brumfield in Washington, D.C., Jennifer Sinco Kelleher in Honolulu, Gene Johnson in Seattle and Sudhin Thanawala in San Francisco contributed to this report.