SAN FRANCISCO — The California Supreme Court has narrowed the scope of a state ballot measure that allowed some three-strike inmates to get shorter prison terms.

In a unanimous ruling on Monday, the court said judges could consider facts in charges that were previously dismissed against the inmates to deny them a reduced sentence.

At issue in the ruling was a 2012 ballot measure — Proposition 36 — that allows three-strike inmates to receive sentence reductions if their third offense was neither serious nor violent. Inmates who used a firearm are among those who do not qualify.

In Monday’s ruling, the defendant, Mario Estrada, argued that a judge wrongly refused to resentence him on the grounds that he was armed during a 1996 theft because prosecutors had dismissed a robbery count and firearm allegation as part of his plea deal.