North Carolina Gov. Pat McCory has signed legislation banning so-called sanctuary cities and limiting the kinds of identification documents acceptable to determine an individual’s identity or residency.

McCrory, a Republican, signed the Protect North Carolina Workers Act into law Wednesday. The legislation prohibits jurisdictions in the state from adopting policies that restrict local cooperation with federal immigration authorities, also known as sanctuary cities.

“Today, North Carolina is standing up for the rule of law, which is central to North Carolina values and our country’s values,” McCrory said in a statement. “Public safety officials must have the flexibility and tools to investigate crimes and sanctuary city policies deprive law enforcement of those tools.”

The legislation has been slammed by immigration activists who charge it targets illegal immigrants and goes too far.

“I live with fear all days, every days. When I drive, I think when I see a police they can stop me and ask me about the documents,” Carmen Rodriguez, an illegal immigrant who publicly protested the bill last month, told WNCN News.

Proponents of the legislation argue it is an issue of public safety and principle.

“When I go to other countries I go legally and adhere to the laws,” Guilford County Sheriff BJ Barnes said in a statement Wednesday in conjunction with the bill’s signing. “Can we not, as the greatest nation in the world, expect others to do the same?”

The McCrory signed the bill in Barnes’ office.

The new law also prevents government entities allowing the use of consulate documents to determine an individual’s identity or residency, requires companies doing business with the state to verify the legality of their employees via E-Verify and adds a new 20-hour work requirement for able-bodied adults without dependents to be eligible for nutrition assistance benefits like food stamps.