A federal judge in Iowa halted the state's effort to enforce its own immigration laws on Monday.

The Iowa law would have allowed the state to file criminal charges against illegal immigrants who have outstanding deportation orders or who previously had been denied entry to the U.S.

U.S. District Court Judge Stephen Locher's block on enforcement is only temporary as the Iowa legislation is further litigated. Locher said he nevertheless believes the law will fail because federal immigration law supersedes that of states.

"As a matter of politics, the new legislation might be defensible. As a matter of constitutional law, it is not," Locher's ruling read. "Under binding Supreme Court precedent, Senate File 2340 is preempted in its entirety by federal law and thus is invalid under the Supremacy Clause."

FOX EXCLUSIVE: MIGRANTS GREED UNDER ICE PROGRAM EXPLODED TO OVER 7.4 MILLION

migrants processed at the border

A federal judge in Iowa halted the state's effort to enforce its own immigration laws on Monday. (Qian Weizhong/VCG via Getty Images)

Republican Iowa Gov. Kim Reynolds signed the "illegal re-entry" bill into law earlier this year. It followed similar legislation in Texas. Officials in both states have heavily criticized President Biden's handling of border policies.

Reynolds and Iowa Attorney General Brenna Bird said the state plans to appeal the ruling.

FBI DIRECTOR WRAY WARNED OF TERROR THREAT POSED BY OPEN BORDER DAYS BEFORE 8 ISIS SUSPECTS ARRESTED ACROSS US

"Iowa never would have had to pass this law to begin with if it weren’t for Biden’s open borders," Bird said in a statement after the ruling. "Rather than suing Iowa for enforcing immigration laws, he should do his duty to secure the border."

Kim Reynolds speaks

Republican Iowa Gov. Kim Reynolds signed the "illegal re-entry" bill into law earlier this year. It followed similar legislation in Texas. Officials in both states have heavily criticized President Biden's administration's handling of border policies. (Scott Olson/Getty Images)

Reynolds, meanwhile, argued that the Biden administration has left states "defenseless" against the "ongoing crisis at our southern border."

FORMER ASSISTANT FBI DIRECTOR WARNS AGAINST 'HUGE VULNERABILITY' ASSOCIATED WITH BORDER SURGE

"Plainly, the Biden administration is failing to do their job and enforce federal immigration laws allowing millions to enter and re-enter without any consequence or delay," she added.

Supreme Court

U.S. District Court Judge Stephen Locher's ruled that Iowa's immigration law is blocked thanks to a 2015 Supreme Court ruling. (AP Photo/Jacquelyn Martin, File)

CLICK HERE TO GET THE FOX NEWS APP

Iowa's law was due to take effect on July 1. The Justice Department has announced plans to go after a similar piece of legislation in Oklahoma in the coming weeks.

The Associated Press contributed to this report.