SACRAMENTO — After five round-the-clock days of legislative horse trading and stalemates, California’s judicial leaders scored two key political victories Thursday as state lawmakers finally closed a $40 billion budget deficit.

Among the three-dozen bills legislators sent to Gov. Arnold Schwarzenegger’s desk to handle the shortfall was language that lets counties continue paying extra benefits to local judges. Proponents say that bill effectively overturns a Fourth District ruling from October finding that only the state, not counties, can set compensation levels for judges.