SAN DIEGO — The San Diego City Council Tuesday formally approved an ordinance requiring gun owners to store their weapons in a locked container or disable them with a trigger lock when not in use or being worn on their person.

City Attorney Mara Elliott proposed the ordinance last month with the intention of reducing accidental shootings, children's access to guns and suicides. According to Elliott, 46% of gun owners in the U.S. who have children do not secure their guns and 73% of youngsters aged 9 and under know where their parents keep their guns.

Since 2002, the state has mandated that all guns sold in California have an accompanying trigger lock approved by the state Department of Justice's Bureau of Firearms. Elliott said the ordinance is a "common-sense approach" to building on current state requirements.

The council took a second vote on the ordinance, as required by the city charter, after tentatively approving it 6-2 earlier this month. City Councilman Mark Kersey, absent for the first vote, chose to join the technically nonpartisan council's six Democrats in favor of adopting the ordinance, arguing that both sides of the debate had merit.

RELATED: San Diego City Council votes in favor of ordinance that would require residents to securely store guns

"I actually find trigger locks to be cumbersome and think that a safe next to your bed is far easier to deal with," Kersey said. "That said, I'm also a parent and I've got a 13-year-old son. And I will tell your that 13- year-old boys, especially, will do dumb things. ... And I can tell you that it is also true that we need fewer kids having access to weapons."

The measure's supporters include gun control advocacy groups such as San Diegans for Gun Violence Prevention and Never Again California, as well as the San Diego Police Officers Association.

The proposal's opponents, including the California Rifle and Pistol Association and the San Diego County Gun Owners political action committee, said it infringes on their Second Amendment rights, particularly for gun owners who do not have children living with them.

Under current state law, gun owners are required to keep firearms in a secure container or disabled with a device like a trigger lock only if they live with a person who cannot legally have a weapon under state or federal law.

Opponents also argued the ordinance is unenforceable and that locking a gun in a safe would make it difficult to access and use in a moment of self- defense.

According to Elliott, the San Diego Police Department will enforce the law by finding improperly stored guns in a home during a visit for another reason such as a domestic disturbance.

Elliott compared the proposal to the state's 1986 law requiring drivers to wear a seatbelt; at that time, highway patrol officers could only cite drivers for not wearing a seatbelt during a traffic stop for another infraction.

City Council members Scott Sherman and Chris Cate voted against the ordinance Tuesday as they did the first time. The 7-2 vote means the council's approval is not subject to a mayoral veto.