RICHMOND, Va. (AP) — President Donald Trump’s latest travel ban on travelers from six largely Muslim countries is “unconstitutionally tainted with animus toward Islam,” a federal appeals court ruled Thursday, delivering another blow to the policy.

In a 9-4 vote, the 4th U.S. Circuit Court of Appeals in Richmond said it examined statements made by Trump and other administration officials, as well as the presidential proclamation imposing the ban, and concluded that it “second-guesses our nation’s dedication to religious freedom and tolerance.”

The 4th Circuit is the second federal appeals court to rule against the ban. In December, the 9th U.S. Circuit Court of Appeals found that Trump exceeded the scope of his authority with the latest ban.

The 4th Circuit court upheld a ruling by a federal judge in Maryland who issued an injunction barring enforcement of the ban against people from Chad, Iran, Libya, Somalia, Syria and Yemen who have bona fide relationships with people in the U.S.

The U.S. Supreme Court has already agreed to hear the travel ban case in April. In December, the high court said the ban could be fully enforced while appeals made their way through the courts.

In its ruling, the 4th Circuit said the ban has a “much broader deleterious effect” than banning certain foreign nationals. The ban, the court said, “denies the possibility of a complete, intact family to tens of thousands of Americans.”

“On a fundamental level, the Proclamation second-guesses our nation’s dedication to religious freedom and tolerance,” Chief Justice Roger Gregory wrote for the court in the majority opinion.

American Civil Liberties Union Deputy Legal Director Cecillia Wang, who argued the case before the court, said she was not surprised by the ruling.

“The Constitution prohibits government actions hostile to a religion,” Wang said.

The International Refugee Assistance Project, one of the groups challenging the ban, said the policy has had a “devastating impact” on U.S. families waiting to reunite with their family members and foreign students seeking educational opportunities in the U.S.

“Today’s ruling affirms that they are being unjustly targeted by this ban,” said Mariko Hirose, the group’s litigation director.

The administration has said the ban is a legitimate measure to protect national security.

During a hearing before the 4th Circuit in December, Deputy U.S. Assistant Attorney General Hashim Mooppan told the judges that the president has broad authority to bar foreign nationals he believes would be detrimental to the interests of the United States. He said the latest restrictions were the product of a global, multiagency review that found the specified countries do not share enough security-related information with the U.S. He said the ban is designed to protect the nation from terrorism and other threats.

In a dissenting opinion, Judge Paul Niemeyer said the 4th Circuit’s ruling was an attempt to “second-guess U.S. foreign policy, in particular, the president’s discretionary decisions on immigration, implicating matters of national security.”

Niemeyer said the majority should have based its decision on the text of the presidential proclamation alone and not considered statements Trump made on the campaign trial and after he became president.

“At bottom, the danger of this new rule is that it will enable a court to justify its decision to strike down any executive action with which it disagrees. It need only find one statement that contradicts the official reasons given for a subsequent executive action and thereby pronounce that the official reasons were a pretext,” Niemeyer wrote.

The ruling was the second time the 4th Circuit has rejected a travel ban. In May, the court cited Trump’s remarks on Muslim travelers while rejecting an earlier version of the ban, finding it “drips with religious intolerance, animus and discrimination.”

Trump announced his initial travel ban on citizens of certain Muslim-majority nations shortly after taking office in January, bringing havoc and protests to airports around the United States. A federal judge in Seattle soon blocked it, and courts since then have wrestled with the restrictions as the administration has rewritten them.

The latest version blocks travelers from the listed countries to varying degrees, allowing for students from some, while blocking other business travelers and tourists, and allowing for admissions on a case-by-case basis.