SACRAMENTO, Calif. (AP) — A bill approved Tuesday by the California Senate to end bail and replace it with a risk-assessment system is headed to Gov. Jerry Brown, who has indicated he supports it.

Senators approved the bill 26-12. It would make California the first state to completely end bail for suspects awaiting trial.

The measure, SB10, requires Brown's signature to become law. Lawmakers who crafted it say Brown was involved in negotiations on the policy.

"Today, the legislature took an important step forward in reducing the inequities that have long plagued California's bail system," Brown said in a statement.

Senators supporting the bill say it would end a system that discriminates against low-income people. Sen Bob Hertzberg, who authored the bill, said the current system unfairly upends suspects' lives simply because they are poor before they are tried in court.

"Money bail does nothing to make people safer and ensure that people show up in court," the Van Nuys Democrat said during debate on the Senate floor. "The evidence is overwhelming that the current system is a failure."

Opponents say they worry the bill will make communities less safe and won't create a fairer system.

"It's going to come back to haunt this house," said Sen. Mike Morrell, a Republican from Rancho Cucamonga. "This is a disaster."

The bill calls for the release of most suspects arrested for nonviolent misdemeanors within 12 hours of booking, while those accused of serious, violent felonies would be ineligible for pretrial release.

Courts and the state's Judicial Council would have wide latitude to determine whether to release other suspects based on the likelihood they'll return to court and the danger they pose.

Some criminal justice reform groups that once supported the bill oppose the final version, arguing it now gives judges too much power to keep people in jail.