California will become the first state to let people leave jail before trial without having to post bail, under a law signed by Gov. Jerry Brown on Tuesday that largely leaves pretrial release decisions up to local judges — a change praised by legislative and judicial leaders but condemned by some criminal defense advocates.

SB10 abolishes the long-standing system of requiring newly arrested defendants to put up bail, in an amount based on the seriousness of the charges, to be freed while awaiting trial. Bail-bond companies and other advocates say the current bail system promotes public safety and encourages defendants to show up in court, but opponents note that poor people are kept in jail because they can’t afford to pay their way out.

More than 48,000 county jail inmates in California — two-thirds of the jail population — have not yet been convicted of a crime, and most of them are being held because they are unable to post bail, according to a recent state study.

With the new law, scheduled to take effect in October 2019, “California reforms its bail system so that rich and poor alike are treated fairly,” Brown said Tuesday after signing the bill.

Assemblyman Rob Bonta, D-Alameda, a co-author of the bill, said the bail system “has allowed the wealthy to purchase their freedom regardless of their risk, while the poor who pose no danger languish in jail.” The new measure was also praised by Chief Justice Tani Cantil-Sakauye after the state’s Judicial Council, which she chairs, took an unusually public position in successfully pushing for revisions to an earlier version of SB10. The current system was “outdated, unsafe and unfair,” she said in a statement, and it took a “three-branch solution” — the governor, legislators and judicial leaders — to eliminate it.