SAN JOSE — City residents who own guns will have to to lock them up when they leave home under a new law set to take effect in December.

The San Jose City Council approved the hotly-debated ordinance on a 6-5 vote late Tuesday, with some of the city’s elected leaders favoring stronger protections. The San Jose law is similar to safe-storage gun laws in San Francisco, Oakland, Sunnyvale and Berkeley. State law requires that guns be locked up or secured only in homes with young children.

The council vote came amid emotional testimony from some residents who feel it will tamp down gun violence. Louis Pandula choked up as he told city leaders about the worst day of his life: When his daughter was shot in the head six years ago by a fellow San Jose State student.

“My daughter Kristina had a heart full of courage,” Pandula said tearfully. “When an assailant shot her boyfriend… Kristina did not run, she did not cower in fear, but instead she used all the courage in her soul to try and save her boyfriend’s life.”

The man, Ricardo Moreno, shot 26-year-old Kristina in the head in October 2011 and she died 12 hours later. Moreno was later killed by police when he was found wandering shirtless, drunk and high on drugs.

But other residents said the measure won’t stop gun violence. One man demonstrated how long it takes to disable a trigger lock from the podium — seconds, he said, that could cost someone’s life in an emergency.

“Not a single one of the tragedies described would have been prevented by this law,” said David Freedman. “The only real effect of this is making owning firearms a little more inconvenient and more expensive.”

The new law, proposed last year by Councilman Raul Peralez and former Councilman Ash Kalra, now a state Assemblyman, requires gun owners to secure firearms either in a gun safe or lock-box or with a trigger lock when they leave home in an effort to curb gun violence and suicides.

The new policy won’t penalize gun owners who report a stolen firearm within 24 hours, in an attempt to ensure people aren’t deterred from reporting stolen weapons. According to city data, 265 firearms were reported stolen during 8,883 home burglaries from 2014 to 2017.

Anyone caught violating the new city law could face six months in jail or a fine of up to $1,000.

Though he supports the measure, San Jose Police Chief Eddie Garcia said enforcement might be tricky — police would need to find a gun that’s been stolen and prove the owner left it unlocked inside the house. The chief also acknowledged that burglars could steal a gun with a trigger lock or even a lock-box, but said the law still helps.

“It’s a deterrent,” Garcia said. “We just want to make it as difficult as possible for someone to steal a firearm from a home.”

In the wake of this month’s mass shooting in Las Vegas, Peralez wanted the law he had proposed to go farther. On Tuesday he joined Councilman Chappie Jones in urging a requirement that gun owners lock up their weapons inside the house at all times — whenever it’s not on their body.

That idea was met with criticism from some council members who said it’d be nearly impossible to enforce.

Councilman Lan Diep agreed, saying that the policy is far-reaching and it’s too cumbersome to require people to lock up their weapons. He instead proposed a law penalizing gun owners if their unlocked firearm is used in a crime. That idea was criticized by Peralez and failed to garner support.

“That would be putting in a law that requires a child to shoot or kill someone else before we do something about it,” said Peralez, an ex-cop who is now a reserve officer. “To me that’s not good enough.”

Along with Peralez and Jones, council members Sergio Jimenez, Tam Nguyen and Donald Rocha also voted no in favor of stronger protections.

Though most gun safety advocates favored the more stringent proposal from Peralez and Jones, they called Tuesday’s decision a step in the right direction.

Rev. John Rodgers of the First Century Evangelistic Group said the new policy could help save lives, especially if other cities adopt similar measures. Rodgers and his partner were shot three decades ago by an unknown assailant in Reno. Rodgers said he still has a bullet lodged in his spine, but his partner paid a far greater price.

“My partner died in my arms that night,” Rodgers said.