Councilman Paul Krekorian, who authored the measure, said he wants to prevent children or others from unintentionally harming themselves or others with the weapons.
"It's unacceptable to live in a country where it's more dangerous to be a preschooler than to be a police officer," Krekorian said.
Krekorian was referring to a statistic in a New York Times op-ed that noted 82 "preschoolers," or children 4 years or younger, were fatally shot in 2013, compared with 27 police officers killed while in the line of duty -- most with guns -- that same year.
Krekorian said the passage of the gun storage law means "we can once and for all mandate that people who own guns -- people who have guns in their homes for safety -- just exercise the basic, common-sense safety storage measures that even the National Rifle Association recommends."
He urged gun owners to "lock it up, keep it unloaded and make sure it's safely stored."
Krekorian told reporters after the vote that he was recently approached by some gun owners who insisted they should be allowed to keep their weapons under their pillows.
Even though the handguns must be disabled or locked away, the law will also allow the weapons to be carried by the owner or any authorized person over the age of 18, or within close enough proximity that the gun is in their control.
Those allowances take into account situations such as when a person is cleaning a gun, or when a police officer needs to carry the guns around the house for some reason, officials said.
Some who have been pushing for the gun storage law said they were uneasy with the provisions. Rhonda Foster with Women Against Gun Violence asked the council to exclude the allowances, saying "our homes are our sanctuary, our safe haven."
"Walking around armed with your gun, that could leave room for accidents as well," she said.
Asked if he was concerned the provisions could create ambiguity in the law, Krekorian said the intent of the law is to make sure the guns are always in a person's control whenever they are not disabled or locked away.
The law sets a "pretty clear mandate, and how that will be applied in any given situation by the courts ... That's why we have the courts, they'll apply it in an appropriate way," Krekorian said.
Krekorian initially struggled to get council action on the gun storage measure, which faced some resistance in the Public Safety Committee after Los Angeles Police Protective League officials asked that retired and reserve officers be exempt. Those exemptions were later dropped, replaced by the allowances.
"Well, then you have it out, and it's not locked up and it's in your home," Englander said. "I want to thank Mr. Krekorian, and the City Attorney's Office that worked very, very diligently in making sure this approach really makes sense, and it does," Englander said. "That's why I support it 100 percent."
Krekorian said there will not be "comprehensive dragnets" to enforce the law, which will more likely come into play if an accidental shooting occurs, when police respond to a domestic violence call, during county welfare checks on foster children or other similar situations.
If signed by Mayor Eric Garcetti, the law would go into effect 30 days later.
The storage law is one of two gun-related measures the city of Los Angeles has tackled in recent months. Earlier this summer, the city adopted a ban on possessing ammunition magazines holding more than 10 rounds. That law, which goes into effect next month, is being challenged in a lawsuit filed by a pair of law enforcement groups, more than two dozen county sheriffs and the California Rifle and Pistol Association, an official state affiliate of the National Rifle Association.