North Carolina Governor Pat McCrory at the U.S. Chamber of Commerce February 23, 2015 in Washington, DC.
(2015 Getty Images)

GREENSBORO, N.C. (AP) – North Carolina Gov. Pat McCrory signed legislation on Wednesday that targets "sanctuary cities" and immigrant identification, turning back pleas from advocates to veto a bill that they say harms immigrants and businesses that rely on immigrant labor.

McCrory used a room inside the Guilford County Sheriff's Office in downtown Greensboro as a backdrop to sign the measure. He was flanked by Sheriff BJ Barnes and other local law enforcement and political leaders.

"Public safety officials must have the flexibility and tools to investigate crimes and sanctuary city policies deprive law enforcement of those tools," McCrory said.

McCrory passed out pens and shook hands, then left the 20-minute ceremony without talking with reporters who crowded into the room.

While protesters have been a constant presence at the Executive Mansion in Raleigh to urge McCrory to veto the measure, there were no protesters seen around the sheriff's office. Critics of McCrory's decision held a news conference a few blocks away.

The bill was among roughly a dozen that McCrory had yet to act upon from the dozens the General Assembly approved in the final days of this year's session. The governor has until midnight Friday to sign or veto the remaining bills. Otherwise, they become law without his signature.

The legislation was approved largely upon party lines favoring Republicans. It prevents government officials or police from accepting identification cards issued by the Mexican consulate or by other consulates to affirm someone's identity. The cards, which bill supporters argue are unreliable and favored by immigrants in the country unlawfully, also couldn't be used to confirm one's identity to obtain a driver's license, insurance or Medicaid coverage.

Also barred are ID cards issued by local governments or outside organizations, although they could be used by police when a person stopped has no other ID. Several other types of ID remain acceptable.

The measure also prohibits local governments from approving policies that supporters say improve uneasy relations between police and immigrants and encourages crime victims to come forward.

In addition, many more government contracts will be contingent on employees of contractors and subcontractors complying with E-verify requirements to check the immigration status of workers. And the bill prevents the state from seeking federal government waivers allowing healthy adults without dependents from receiving food stamps beyond three months unless they're working or getting training.

Barnes, the Guilford sheriff, said McCrory did the right thing in signing the bill, especially when it comes to sanctuary cities.

"Sanctuary cities give people a false sense," Barnes said. "If Greensboro is telling their police officers not to enforce the laws of the federal government and that we have, then that's going to give them a false sense. They're going to end up being caught and being held for not having the proper ID."

A handful of North Carolina towns and cities – Durham, Chapel Hill and Carrboro among them – instruct law enforcement and other officials not to ask the immigration status of people with whom they come into contact or ignore deportation orders in some cases.

The North Carolina Justice Center issued a statement saying it was "deeply disappointed" by McCrory's decision to sign the bill.

"We have consistently called for the governor to veto this harmful legislation. The law undermines how local governments address their own needs when it comes to immigrant communities and makes North Carolina appear to be a hostile place for newcomers of all identities," the center's statement said.

The American Friends Service Committee also issued a statement opposing the bill.

"We embrace and celebrate the contributions that immigrants have made to our state and urge our policymakers to expand – not restrict – ways for immigrants to participate in mainstream society," Lori Fernald Khamala of the American Friends Service Committee said in the statement.