U.S. District Judge Beth Bloom said in her ruling Tuesday that the law was racially motivated, and that supporters of the measure failed to show evidence that it was needed to lower crime.

Bloom also said anti-immigrant hate groups such as Floridians for Immigration Enforcement were heavily involved with both the bill, SB 168, and its sponsor.

“Allowing anti-immigrant hate groups that overtly promote xenophobic, nationalist, racist ideologies to be intimately involved in a bill’s legislative process is a significant departure from procedural norms,” Bloom wrote. “This involvement strongly suggests that the Legislature enacted SB 168 to promote and ratify the racist views of these advocacy groups.”

For more reporting from the Associated Press, see below.

The office of Governor Ron DeSantis, who signed the bill into law with much fanfare in 2019 as a priority of his administration, said Wednesday that it would appeal.

Bloom cited numerous communication between Floridians for Immigration Enforcement and state Senator Joe Gruters’ staff. Gruters sponsored the bill and also serves as chairman of the state Republican Party.

“On many occasions during the 2019 legislative session, (Floridians for Immigration Enforcement’s ) racial animus and discriminatory intent were made apparent to Senator Gruters and his staff but were ignored,” Bloom wrote.

Gruters didn’t immediately respond to a message left on his cellphone.

In 2019, DeSantis signed the bill at a campaign-style appearance in the conservative Panhandle region, unlike his other more subdued formal bill signing events. An overflow crowd dotted with red “Make America Great Again” hats cheered wildly in support of the bill. They also cheered equally loud at mentions of then-President Donald Trump.

The governor’s office defended the law Wednesday.

“Yet again a federal trial court judge partially enjoins a plainly constitutional state statute,” said DeSantis spokeswoman Taryn Fenske. “We disagree with the judge’s ruling and expect to win on appeal.”

Democrats and immigrant advocates praised the ruling.

“Floridians deserve a legislature that prioritizes people over politics, not one that repeatedly squanders taxpayer money defending extreme legislation designed to bolster the Governor’s political ambitions. Florida has and will always be an immigrant state,” said Democratic state Representative Carlos Guillermo Smith in a statement.

Many of the bills DeSantis has signed in the law have been challenged in court, where he’s often lost in lower courts. The state has appealed those rulings, including an “anti-riot” law inspired by Black Lives Matter protests around the country, a ban on vaccine passports and punishments for large social media companies such as Twitter and Facebook who block people based on political posts. He’s also being challenged on state orders to ban mask mandates in schools.

Among other laws being challenged in court: New election rules that make it more difficult to vote by mail, a ban on the participation of transgender women and girls in school sports and limits on contributions to groups seeking to change the state constitution.