SAN FRANCISCO — The California Supreme Court on Thursday expanded the scope of a ballot measure that limits prosecutors from charging juveniles with crimes in adult court.

The court ruled unanimously that Proposition 57 applies to cases that were pending before it took effect. The justices said voters appeared to want to extend the measure as broadly as possible.

It was not immediately clear exactly how many cases would be affected by the ruling.

Donald Ostertag, a Riverside County deputy district attorney, estimated during oral arguments that 1,000 or more cases could be impacted.

Proposition 57, approved in 2016, requires judges instead of prosecutors to decide whether criminal cases belong in juvenile or adult court.

Associate Justice Ming Chin, writing for the state Supreme Court in Thursday’s ruling, noted that penalties in adult court can be much more severe, so there were “potentially major consequences for juveniles.”

“While a person convicted of serious crimes in adult court can be punished by a long prison sentence, juveniles are generally treated quite differently, with rehabilitation as the goal,” he said.

The decision came in the Riverside County case of a juvenile charged as an adult with kidnapping and sexually assaulting a girl. The defendant was awaiting trial when Proposition 57 passed, and an appeals court said he was entitled to a hearing to determine whether his case belonged in juvenile court or adult court.

The California Supreme Court upheld that decision. The ruling also applies to cases in which a juvenile is appealing a conviction.

Prosecutors in Riverside County wanted the case to stay in adult court. John Hall, a spokesman for the office, said in a statement that prosecutors “appreciate that this issue has been clarified moving forward” and would implement the court’s decision.

Proposition 57 also lets felons seek parole more quickly and gives corrections officials broad discretion to grant early release credits. It was backed by Gov. Jerry Brown as a way to keep the inmate population below a cap set by federal judges.