San Francisco, one of the first sanctuary cities in the nation, plans to end its cooperation with federal immigration officials and start releasing illegal immigrants arrested for minor offenses before they can be picked up for deportation.

The city's decision is the latest development in a tug of war between several communities and the federal government over its controversial national program that automatically checks the immigration status of arrestees.

Officials in jurisdictions including Providence, R.I., and Chicago have also challenged the program, which they say undermines trust that it has taken local law enforcement years to build in immigrant communities.

California and Illinois lawmakers are considering measures to let communities retreat from the so-called "Secure Communities" program, which links up the FBI's criminal database and the Department of Homeland Security's records so that every time someone is arrested their immigration status is automatically, electronically checked.

Washington state has deferred to local governments on whether they want to join program overseen by U.S. Immigration and Customs Enforcement (ICE).

But their efforts could be thwarted as federal officials argue that states have no control over what information is shared among federal agencies.

In the absence of a nationwide fix on immigration, the tension between states and the federal government has been simmering in recent years. In the last four years, states have passed a flurry of bills and resolutions on issues ranging from employer verification to access to driver's licenses, most notably Arizona's tough local immigration enforcement law.

Immigrant advocates have lambasted ICE's fingerprint sharing program for sweeping up crime victims and witnesses who are arrested during an investigation in addition to those accused of committing a crime. About 29 percent of the 102,000 immigrants deported under the program since it began in 2008 have no criminal conviction, according to federal government statistics.

Between October 2008 and March 2011, more than 7 million people who have been arrested have had their fingerprints run through the ICE program. Roughly 197,000 were identified as suspected illegal immigrants, and nearly 40 percent of those were in California, according to statistics provided by ICE.

In San Francisco, Sheriff Michael Hennessey told the San Francisco Examiner he is making the change effective June 1 to comply with the city's sanctuary ordinance.

The law, which has caused tension between local and federal authorities, prohibits officials from assisting ICE in cases that do not involve felonies.

The city currently keeps low-level offenders ICE has identified as illegal immigrants through fingerprints until immigration officials collect them. The Examiner reports that 111 inmates were detained for deportation between last June and February.

ICE spokeswoman Virginia Kice told the newspaper that Hennessey's decision was unfortunate.

Immigration attorney Francisco Hernandez told Fox News on Saturday that the city still has to hold suspects for 72 hours if federal immigration officials ask.

"That is the law," he said. "The question is whether they are going to be reporting people that are committing speeding tickets or small violations rather than the felonies or criminal people that should be deported under the criminal alien program."

Hernandez said that approach is the one being used across the country.

But Mike Cutter, a former senior special agent for the now defunct U.S. Immigration and Naturalization Service (INS), sought to highlight the significance of the program by estimating that about half of the FBI's 10 most wanted get arrested for motor vehicle violations.

"If you have somebody in custody who is an illegal alien, it's important that immigration does get notified," he said, arguing that the debate is minimizing the reason for immigration laws in the first place. He said the law lists categories of illegal immigrants that cross the border because they know they couldn't get through the inspections process, including terrorists, drug dealers, pedophiles, human rights violators and war criminals.

"So if you have somebody who ran the border, somebody whose presence is illegal and you have them in custody, it's in everyone's best interest, including the people in the immigrant communities who very often fall victim to criminal aliens, to have ICE pick them and let ICE make a determination as to whether or not these folks are a priority to remove," he said.

But Hernandez said law enforcement does not have the resources to arrest everyone stopped for a speeding ticket.

"We have to focus our resources on things that are more serious and people that have actual criminal warrants for serious offenses," he said.

The debate over the ICE program is playing out across the country as federal authorities aim to achieve nationwide coverage in 2013. It currently is in effect in more than 1,200 jurisdictions in 42 states.

Immigration officials say the goal is to ensure illegal immigrants who commit crimes are flagged and deported. Nationwide, about 26 percent of those deported under program have been convicted of major drug offenses or violent crimes.

Some communities have welcomed the program as a cost savings measure and a way to ensure illegal immigrants who commit crimes are not released back into their neighborhoods. In Colorado, for example, lawmakers were considering a measure to withhold funding from localities that refused to participate, but it failed.

The Associated Press contributed to this report.