The bill sent to Gov. Jerry Brown follows several high-profile thefts from the vehicles of law enforcement officers in the San Francisco Bay Area.
SB869 by Democratic Sen. Jerry Hill of San Mateo was approved in a 26-12 vote. It would require that handguns left in unattended vehicles be locked in the trunk or in a locked container out of view.
Violating the law would be an infraction punishable by a fine of up to $1,000.
The measure was supported by gun-control groups and the California Association of Highway Patrolmen, which says stolen guns can be used in crimes.
Nobody spoke against it in the Senate Wednesday.