SACRAMENTO — People living in the country illegally could not be detained for deportation if they are arrested for a minor crime, under a bill passed Thursday by the California Assembly.

The measure from Assemblyman Tom Ammiano, D-San Francisco, would create a statewide standard for how local agencies should comply with a federal program requiring immigration status checks of anyone arrested.

The federal Secure Communities program requires people found to be in the U.S. illegally to be held for immigration officials.

But Ammiano said the majority of the 95,000 people in California who have been detained and deported did not have criminal records, including some who were victims of domestic violence.

Under AB4, known as the Trust Act, local law enforcement would be able to detain only people who were previously convicted of a serious or violent felony.

"California cannot afford to expend vital resources on the prolonged detention of people who pose no threat to public safety," Ammiano said.

Supporters say the change would rebuild trust of law enforcement in immigrant communities, increasing public safety by encouraging cooperation with police.

Opponents said it would remove a tool of law enforcement. They also questioned whether federal funding could be jeopardized by not following national immigration policy.

"It is an important safety net to make sure that we are able to capture people who might have fallen through the cracks who are serious criminals," Assemblyman Tim Donnelly, R-Twin Peaks, said about the federal program.

The Assembly passed the bill with a 42-20 vote, sending it to the state Senate. Two Democrats, Assemblymen Ken Cooley of Rancho Cordova and Tom Daly of Anaheim, joined Republicans in opposing the bill.

Gov. Jerry Brown vetoed similar legislation last year, saying the bill did not allow officials to detain those convicted of crimes such as child abuse and drug trafficking.

Ammiano's revised bill also does not allow for detainment on those crimes, but the lawmaker said he is willing to work with the governor on changes.

Several supporters noted ongoing efforts in Congress to craft an immigration reform plan, saying California shouldn't wait for work in Washington to be completed before updating local procedures.

"We can't be saying we're going to provide a path to citizenship and then throw up obstacles to that," Ammiano said.