North Carolina Gov. Roy Cooper (D) vetoed a bill on Wednesday that would have required local law enforcement to inquire about prisoners' immigration status and comply with federal immigration authorities.

Cooper said the bill, which passed the state House on Tuesday and the state Senate in June, was unconstitutional and said it would weaken state law enforcement by asking sheriffs to do the job of federal agents. Both chambers are controlled by Republican majorities.

"This legislation is simply about scoring partisan political points and using fear to divide North Carolina. As the former top law enforcement officer of our state, I know that current law allows the state to jail and prosecute dangerous criminals regardless of immigration status," Cooper said in a statement. ADVERTISEMENT

"Finally, to elevate their partisan political pandering, the legislature has made a sheriff’s violation of this new immigration duty as the only specifically named duty violation that can result in a sheriff’s removal from office," he added.

The bill would have required local law enforcement officials to determine if a prisoner is a legal resident. If they were unable to do so, local law enforcement officials would have had to reach out to U.S. Immigrations and Customs Enforcement (ICE) or the Department of Homeland Security to inquire about the individual’s status.

The decision was quickly criticized by some North Carolina Republicans, The Charlotte Observer reported.

Republican state Sen. Chuck Edwards said that in vetoing the bill, Cooper is "choosing to side with sheriffs like the Mecklenburg County Sheriff who in June ignored an ICE detainer request on a man in custody for rape and child sex offense charges and released this dangerous individual back into the community."

Mecklenburg Sheriff Garry McFadden wrote in opposition to the bill in June. He said the bill threatened to undermine trust between law enforcement and the immigrant community.

Like Cooper, the sheriff feared the bill could result in North Carolina communities "becoming less safe."

"This is a dangerous experiment in playing politics with our public safety," he wrote.