But the legislation stops short of many of the changes Mr. de León initially included in the days after President Trump’s election, including preventing immigration agents from interviewing inmates in jails and allowing them access to law enforcement databases. The bill also exempts the state Department of Corrections and Rehabilitation from many of the restrictions, though it does require them to offer more protections for immigrant inmates.

The amendments also expand the types of criminal convictions that allow local law enforcement agents to transfer and share information about inmates.

For Mr. de León, the legislation was the most high profile attempt to expand protections for undocumented immigrants in the Trump era. But from the beginning, the California Sheriff’s Association opposed the effort, saying it would increase public safety risks. And Gov. Brown voiced reservations in an interview with NBC’s “Meet the Press” last month. Immigrant rights activists staged protests for the legislation, arguing it was necessary to defend people from expanded deportation efforts and assuage fears in immigrant communities.

The bill still needs to be approved by the Assembly before the legislature adjourns at the end of this week, where it is expected to pass.