WASHINGTON ― Republican vice presidential nominee and Indiana Gov. Mike Pence won’t be able to follow through on his attempt to discriminate against Syrian refugees, according to a federal appeals court.

The U.S. Court of Appeals for the 7th Circuit ruled unanimously on Monday that the governor has no authority to withhold funding from refugee resettlement organizations that are guaranteed aid under federal law.

But before he got to the substance of the court’s decision, U.S. Circuit Judge Richard Posner ― a Ronald Reagan appointee who is known for his biting and highly readable language ― said Pence cannot rely on an unfounded “fear of terrorist infiltration” to take steps that otherwise discriminate against Syrians.

“The governor of Indiana believes, though without evidence, that some of these persons were sent to Syria by ISIS to engage in terrorism and now wish to infiltrate the United States in order to commit terrorist acts here,” Posner wrote. “No evidence of this belief has been presented, however; it is nightmare speculation.”

The ruling ― which was joined by U.S. Circuit Judge Diane Sykes, who happens to be on Donald Trump’s not-so-short list of candidates to the Supreme Court ― arrived a day before Pence, the running mate of Trump, is scheduled to square off against Sen. Tim Kaine (D-Va.) in the first and only vice presidential debate on Tuesday.

In the wake of terrorist attacks in Paris last November, Pence, like more than half of the nation’s governors, announced that he no longer wanted to admit Syrian refugees into his state because of terrorism concerns. Governors don’t actually have the power to keep out refugees, and most governors dropped their plans ― with the notable exceptions of New Jersey, Kansas and Texas, all of which said they won’t assist with refugee resettlement at all.

Pence continued his efforts to keep out Syrians by ordering that organizations that resettled them would be barred from federal funds they use for social services, job training and medical help for the refugees. Exodus Refugee Immigration, a resettlement group, sued Pence in November with the help of the American Civil Liberties Union and the ACLU of Indiana.

The courts haven’t been kind to Pence ― a federal judge issued an injunction to stop his order in February, and has now been thwarted yet again by the 7th Circuit in Chicago, which affirmed the injunction.

That’s because, as Posner pointed out, federal law forbids states receiving resettlement funding to discriminate against refugees on the basis of national origin ― which is clearly what Pence attempted to do ― although he claimed his move was based on perceived security threats.

“[T]hat’s the equivalent of his saying (not that he does say) that he wants to forbid black people to settle in Indiana not because they’re black but because he’s afraid of them, and since race is therefore not his motive he isn’t discriminating,” Posner wrote. “But that of course would be racial discrimination, just as his targeting Syrian refugees is discrimination on the basis of nationality.”

A number of Republicans have claimed that Syrian refugees could be, as Trump puts it, a “Trojan horse” for terrorists to sneak into the country.

But Indiana did not provide evidence that this was happening or that Syrian refugees had committed terrorist acts in the U.S., or been arrested or prosecuted for attempts, Posner wrote. Pence is not allowed “to deport to other states immigrants he deems dangerous,” even if Syrian refugees are a security threat, and he should speak to the federal Office of Refugee Resettlement rather than trying to force them into other states, Posner wrote.

Indiana admitted 174 Syrian refugees in the 2016 fiscal year, but it is unclear how many Exodus dealt with, according to the decision. Public State Department figures for fiscal year 2016 go only to the end of August, when 150 Syrian refugees had been resettled in Indiana. There were 36 cases, which indicates that most of those 150 individuals were part of families.

Cole Varga, executive director for Exodus Refugee Immigration Inc., said they are “delighted with the decision” and “will continue our mission of making Indiana home to refugees without interference.”

The U.S. welcomed more than 10,000 Syrian refugees in total last fiscal year ― a majority of them under the age of 18 ― and aims to admit more than 12,000 in the 2017 fiscal year, according to government officials. That’s only a fraction of the more than 4.8 million Syrian refugees who have fled their homes.

All refugees go through extensive vetting before being admitted to the U.S., including database checks, numerous interviews, screening of their social media accounts and health tests. Although administration officials have said there are challenges in screening Syrian refugees and that there is potential that terrorists could try to infiltrate the system, they have also said the process is continually improving and more extensive than any other way for a foreign national to enter the U.S.

If Trump becomes president, however, the Indiana governor might get his wish to keep out Syrian refugees, most of whom are Muslim. Trump promised a “complete shutdown” of Muslims entering the U.S. last December ― something Pence at the time called “offensive and unconstitutional.”

The presidential nominee now advocates for banning people from “regions of the world that have a history of exporting terrorism” and for ideological tests that he largely frames around Muslim beliefs, something Pence supports.

So the hope of discriminating against Syrian refugees is still alive.

The Trump campaign did not respond to a request for comment. The governor’s office did issue a statement, although it made no mention of the ruling or what comes next. Pence spokeswoman Kara Brooks told HuffPost in an email that they “are continuing to evaluate the ruling.”

“The safety and security of the people of Indiana is Governor Pence’s highest priority,” she said in the statement, before referencing past statements from government officials about potential for security threats in the refugee program.

This article has been updated with additional comment from Pence’s office and from Exodus Refugee Immigration Inc.