Two federal judges have frozen President Trump’s revised travel ban that limits immigration from six mainly Muslim countries, with both agreeing that the executive order discriminates against religion.

US District Judge Theodore Chuang in Maryland issued a nationwide preliminary injunction early Thursday in a case brought by the American Civil Liberties Union and the National Immigration Law Center for refugees and their families.

In his decision, Chuang referenced comments made by Trump and members of his administration that he read as making the case the executive order’s purpose was to ban Muslims.

“These statements, which include explicit, direct statements of President Trump’s animus toward Muslims and intention to impose a ban on Muslims entering the United States, present a convincing case that the First Executive Order was issued to accomplish, as nearly as possible. President Trump’s promised Muslim ban,” Chuang wrote.

Trump, who said the order was necessary to protect the US from terror attacks, removed a preference for religious minorities from the updated version he signed on March 6 with the intent to make it legally bulletproof.

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

His decision comes a day after US District Judge Derrick Watson in Hawaii wrote that “a reasonable, objective observer … would conclude that the executive order was issued with a purpose to disfavor a particular religion.”

The president revised his original travel ban after the US Court of Appeals for the Ninth Circuit upheld a restraining order issued by a federal judge in Washington state.

The new executive order, signed on March 6, removed Iraq from the list of seven mostly Muslim countries where immigration was restricted. It would have gone into effect on Thursday.

White House spokesman Sean Spicer said the Trump administration will appeal the rulings, and the Department of Justice is working out the legal strategy and timing.

Spicer, during the daily press briefing on Thursday, said the president has full authority to suspend immigration in the interests of protecting the country.

“The danger is real and the law is clear, the president was elected to change our broken immigration system and he will continue to exercise his Constitutional authority and presidential responsibility to protect our nation,” he said.

A spokeswoman for the Justice Department called out the “flawed” ruling.

The 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 court,” Sarah Isgur Flores wrote in a statement.