The state of Indiana cannot bar Syrian refugees from settling there, a federal judge ruled this week, ending a years-long battle between immigration advocates and former Governor Mike Pence.

U.S. District Judge Tanya Pratt sided with a refugee agency represented by the ACLU, issuing a permanent injunction against the state of Indiana and the secretary of the Indiana Family and Social Services Administration.

After the November, 2015 Paris attacks, Pence issued a directive that prevented state agencies from giving federal assistance funds to refugee agencies helping Syrians, citing national security concerns. One agency — Exodus Refugee Immigration — sued, claiming Pence’s directive violated equal protection laws and the Civil Rights Act by discriminating against Syrians based on their nationality.

Pratt explained her reason in an earlier ruling granting Exodus a temporary injunction, concluding that “the State’s conduct clearly discriminates against Syrian refugees based on their national origin.”

She added, “the withholding of funds from Exodus that are meant to provide social services to Syrian refugees in no way directly, or even indirectly, promotes the safety of Indiana citizens.”

Pence appealed the temporary injunctionn to the U.S. Court of Appeals for the Seventh Circuit, but the judge dismissed the state’s argument and upheld the ruling.

Jane Henegar, the executive director of the ACLU of Indiana, said in a statement that Indiana’s blocking of refugee resettlement “not only offended our values as Hoosiers, it violated the Constitution and federal law as well.”

“Indiana’s failed refugee ban was a shameful retreat from our values and a preview of discriminatory policies like the Muslim Ban, which the ACLU continues to fight at every turn,” she added.

Pence’s press secretary, Alyssa Farah, told the Indy Star that it “makes sense that Indiana would settle.”