By Miranda Leitsinger, NBC News

California’s governor late Sunday vetoed a bill that would have allowed police and sheriffs to free undocumented immigrants from custody once they became eligible for release even if there were requests by federal immigration authorities to hold them for possible deportation proceedings.

Immigration advocates say the federal requests, known as detainers or holds, cast a wide dragnet that has ensnared even those who had committed minor crimes or no offenses at all. But Immigration and Customs Enforcement had said the program was instrumental in helping enforce immigration laws and in getting violent offenders off the streets.

California Governor Brown

In his veto message, Gov. Edmund G. Brown Jr. said he could not sign the bill because under it, “local officers would be prohibited from complying with an immigration detainer unless the person arrested was charged with, or has been previously convicted of, a serious or violent felony.

“Unfortunately, the list of offenses codified in the bill is fatally flawed because it omits many serious crimes,” he said. “For example, the bill would bar local cooperation  even when the person arrested has been convicted of certain crimes involving child abuse, drug trafficking, selling weapons, using children to sell drugs, or gangs. I believe it’s unwise to interfere with a sheriffs discretion  to comply with a detainer issued for people with these kinds of troubling criminal records.”

Brown noted he would work with lawmakers to improve the legislation and said undocumented immigrants “play a major role inCalifornia’s economy, with many performing low-wage jobs that others don’t want.

“Comprehensive  immigration  reform — including a path to citizenship — would provide tremendous economic  benefits and is long overdue,” he wrote. “Until we have immigration reform, federal agents shouldn’t try to coerce local law enforcement officers into detaining people who’ve been picked up for minor offenses and pose no reasonable threat to their community.”

Immigration activists denounced Brown’s veto, comparing it toArizona’s controversial immigration law that includes a provision forcing those stopped by police to show their immigration papers.

“By vetoing the Trust Act Governor Brown has failedCalifornia’s immigrant communities, imperiling civil rights and leaving us all less safe. The President’s disastrous Secure Communities program is replicatingArizona’s model of immigration enforcement nationally, causing a human rights crisis. Immigration and Customs Enforcement strong-armed the Governor to defend its deportation quota instead of defending Californian’s rights,” Pablo Alvarado, executive director of the National Day Laborer Organizing Network, said in a statement. “On this sad day, we renew our commitment to fight to keep our families together despite the Governor and the President’s insistence on seeing them torn apart.”

Alvarado was referring to ICE’s “Secure Communities” program, under which the FBI shares fingerprints of those arrested with federal immigration authorities who check to see if the person is not legally in the U.S. or if they can be removed due to a criminal conviction.

ICE says it prioritizes the deportation of those who present the most significant threats to public safety, and that it has deported more than 147,400 convicted criminal undocumented immigrants, including more than 54,200 individuals convicted of violent offenses such as murder, rape and the sexual abuse of children, under the program.

In a statement last week, ICE Deputy Press Secretary Gillian Christensen said the agency didn’t comment on pending state legislation.

“The identification and removal of criminal offenders is ICE’s highest priority and over the past three and half years, ICE has been dedicated to implementing smart, effective reforms to the immigration system that allow it to focus its resources on priority individuals,” she wrote in a statement, noting that the Department of Homeland Security would continue to exercise prosecutorial discretion for certain people who came to the U.S. as children and other individuals who were “low priorities.”

“The federal government alone sets these priorities and places detainers on individuals arrested on criminal charges to ensure that dangerous criminal aliens and other priority individuals are not released from prisons and jails into our communities,” she added.

Several counties and cities have enacted ordinances that limit police cooperation with federal immigration authorities, The New York Times has reported.

Assemblymember Tom Ammiano, a San Francisco Democrat who sponsored the legislation, said late Monday that the California State Sheriff’s Association, which had opposed the bill, called his office on Monday to negotiate around the issue, which he took as a “good sign.”

“Governors come and go, you know, but this issue is more than a political issue, it is a movement,” he said.

Some immigration rights’ activists took Brown to task for also vetoing a bill requiring the creation of state regulations governing the working conditions of domestic workers but instead signing off on legislation that would allow some undocumented youth to get a driver’s license.

It is intended for those who qualify for the federal government’s deferred action policy, which provides a two-year work permit and a reprieve from deportation for those who were brought to theU.S.as children. There are some 300,000 youth inCaliforniawho are currently eligible for the policy, according to theImmigrationPolicyCenter.

“Brown waited until the 11th hour of his legislative cycle to … veto the most important and impactful bills that would have (brought) tremendous relief for the immigrant community in California and instead decided to sign a very symbolic and hollow bill,” Carlos Amador, of immigrant rights’ group Dream Team Los Angeles, told NBC News by phone.