RICHMOND, Va. — A second federal appeals court on Thursday struck down President Trump’s latest version of the immigrant travel ban, saying it “is unconstitutionally tainted with animus toward Islam.”

The 9-4 decision by the U.S. Court of Appeals for the 4th Circuit in Richmond, Virginia, took a deep dive into Trump’s statements and tweets since he became president and concluded that the third iteration of his proclamation, like the first two, was motivated not by national security concerns but by antipathy toward Muslims.

“The government’s proffered rationale for the proclamation lies at odds with the statements of the president himself,” wrote Chief Judge Roger Gregory.

“Plaintiffs here do not just plausibly allege with particularity that the proclamation’s purpose is driven by anti-Muslim bias, they offer undisputed evidence of such bias: the words of the president.”

The ruling has no immediate effect. The Supreme Court is already scheduled to decide the legality of the travel ban, holding oral arguments in April and deciding by the term’s conclusion at the end of June.

The U.S. Court of Appeals for the 9th Circuit in San Francisco has also struck down the ban, saying the president violated limits put in place by Congress. As it did in striking down an earlier version of the ban, the 4th Circuit’s opinion issued Thursday said the ban violated the Constitution’s prohibition on religious discrimination.

Seven of the 13 judges wrote separately to explain their reasoning.

Judge Paul Niemeyer, one of the dissenters, denounced his colleagues’ “bold effort to second-guess U.S. foreign policy and, in particular, the president’s discretionary decisions on immigration, implicating matters of national security.”

He added: “Our constitutional structure forbids such intrusion by the judiciary.”

One judge, William Traxler, was in the majority when the 4th Circuit ruled that Trump’s second travel ban was illegal. But he sided with the dissenters this time.

The third version must be judged based on the “context of the investigation and analysis that the agencies acting on the president’s behalf have completed, the consultation that has taken place between the president and his advisers, and the logical conclusions and rationale for the proclamation that are documented therein.”

Traxler was referring to the government’s argument that a long investigation had gone into deciding which countries did not properly vet those leaving their shores for the United States. Based on that investigation, it said, the administration decided to have the ban cover a slightly different list of countries than in the first two versions.

The current version affects various travelers from Syria, Libya, Iran, Yemen, Chad, Somalia, North Korea and Venezuela.

Two federal judges – in Maryland and Hawaii – had blocked implementation, at least in part. In December, the U.S. Court of Appeals for the 9th Circuit upheld the Hawaii ruling, although it said it would allow the administration to enforce the ban on travelers without close U.S. ties, such as relatives. That appeals court ruling also was put on hold in a nod to the Supreme Court.

In early December, the high court had lifted injunctions issued by the judges in Hawaii and Maryland and allowed the ban to fully take effect while the legal challenges continue.

In an opinion concurring with the majority, Judge Pamela A. Harris said that deciding the ban violated the Constitution might in the end be a more narrow decision than deciding thorny questions about the president’s powers under federal statutes governing immigration.

In essence, she wrote, there was no reason to believe that future presidents will take the tack Trump has taken.

“The principle that government decision-making should not be informed by religious animus is so well and deeply understood in this country that there are few violations recorded in the case law,” she wrote. “Though we must today add one more to the list, we have every reason to expect that future occasions for application of this fact-specific holding will be few and far between.”

The Justice Department had no immediate reaction to the ruling.

ACLU Deputy Legal Director Cecillia Wang, who argued the case before the 4th Circuit in December, said the court once again got it right.

“President Trump’s third illegal attempt to denigrate and discriminate against Muslims through an immigration ban has failed in court yet again,” she said in a statement. “It’s no surprise. The Constitution prohibits government actions hostile to a religion.”