Kelly voted against the broader gun bill.
He has been able to get names and addresses of gun owners because certain public record laws do not apply to state lawmakers. He said he wanted to make the information private after a newspaper in New York published a database of gun owners in Westchester County, including names and addresses.
Critics said the publication of the database by the News Journal made gun owners potential robbery targets.
"The problem is, you only need one irresponsible individual," Kelly said. "The horse is out of the barn, not to be put back again."
Maryland law has limited police to releasing only the names of gun owners, not addresses or other information. Still, NRA President David Keene said, the rules needed to be stricter.
"If I can get your name, I can get your address," Keene said. "If that information is out there, it's going to be accessed for nefarious purposes."
O'Malley, who introduced the law, did not object to the records change, a spokeswoman said.
"We were fine with it in order to make sure there was a comprehensive public safety bill that could get through," spokeswoman Raquel Guillory said.
The governor is expected to sign the bill next month.
Vincent DeMarco, president of Marylanders to Prevent Gun Violence, was the most visible lobbyist for the gun bill. He said he was unaware of the provision on records until informed by a reporter.
After researching it, DeMarco concluded that it didn't interfere with what he sees as the law's main mission: To require handgun licenses, which he says will limit the flow of guns to criminals.
Patrick Shomo, president of Maryland Shall Issue, gave fellow pro-gun groups credit for closing gun records to the public.
"It was our idea," he said. "We pushed for that, and it wasn't that big of a sell. There are a number of people up there [in Annapolis] who are liberal progressives, but who have guns" — and don't want others to be able to find out about them.
Del. Kathleen Dumais, a Montgomery County Democrat who played a central role in pushing the gun bill through the House of Delegates, said the change was "absolutely not" motivated by lawmakers' desire to protect their own privacy.
"Do we want the criminals to know where the guns are?" she said. "It was something that we were all concerned about — letting the whole world know who the gun owners are."