Indiana's Mike Pence and other Republican governors were dealt a blow Monday when a federal judge ruled that refusing to allow Syrian refugees to settle within a state is discrimination.

"Federal law does not allow a governor to deport to other states immigrants he deems dangerous," wrote Judge Richard Posner, one of three judges on a U.S. Court of Appeals for the Seventh Circuit panel, according to The Washington Times.

Pence, his party's vice presidential nominee, had balked at President Barack Obama's order to all states that they accept refugees from the war-torn nation. Obama wanted to resettle 10,000 refugees in 2016 but ended up exceeding that number by more than 2,500.

The Times reports that as many as 30,000 Syrian refugees could come to the United States in 2017.

Despite Pence's disagreement with the policy, Indiana took in 174 Syrian refugees in 2016, the Times reports.

"The state of Indiana took decisive action last year to suspend resettlement of Syrian refugees after the terrorist attack in Paris and because the FBI and the Department of Homeland Security acknowledged security gaps with regard to screening refugees from Syria," Pence spokesperson Kara Brooks told the Times.

Posner, according to CNN, also took a shot at Pence ahead of Tuesday night's vice presidential debate between Pence and Democrat Tim Kaine.

There is "nothing to suggest that Indiana is a magnet for Syrians," Posner wrote. He added there is "no evidence that Syrian terrorists are posing as refugees or that Syrian refugees have ever committed acts of terrorism in the United States."

Republican presidential nominee Donald Trump and other members of the GOP have called on the U.S. government to put a hold on accepting refugees from countries with terrorist ties until a better vetting system is put in place.