A federal judge on Friday declared unconstitutional a key provision of California’s Proposition 63 that banned possession of high-capacity gun magazines often used in mass shootings, ensuring that the voter-approved prohibition will remain tied up in court for some time to come.

San Diego-based U.S. District Judge Roger Benitez wrote in his 86-page decision, upholding a lawsuit against the proposed ban of magazines holding more than 10 rounds, that such a statute “hits at the center of the Second Amendment and its burden is severe.”

“Individual liberty and freedom are not outmoded concepts,” he wrote.

California will almost certainly appeal the ruling to the Ninth U.S. Circuit Court of Appeals, which has a history of upholding gun-control laws, and experts expect the matter to eventually wind up before the U.S. Supreme Court. State Attorney General Xavier Becerra said in a statement Friday that he is contemplating his next move.

“We are committed to defending California’s common sense gun laws — we are reviewing the decision and will evaluate next steps,” Becerra wrote.

Voters approved Prop. 63 in 2016 — a proposal assembled by then-Lt. Gov. Gavin Newsom, following a particularly bloody 2015 highlighted by two terrorists killing 14 people and wounding 17 in a San Bernardino rampage.

A 2000 law had already made it illegal for Californians to buy or sell magazines that hold more than 10 cartridges, but it allowed people who already owned them to keep them. Prop. 63, among other provisions which tightened ammo regulations, went a step further by requiring anyone who owned such magazines to turn them in, remake them to comply with the law, or send them out of state.

That aspect of the law never has taken effect, though. The National Rifle Association sued to overturn it and Benitez’s ruling on Friday ensures that this part of the law will remain ineffective unless there is a countermanding court ruling in the case.

The magazine restriction was due to take effect in July 2017, but Benitez had issued a statewide injunction against it two days before its start date.

In his Friday ruling, the judge cited three home invasions in which women fought against the attackers and, he said, would have been more effective if they’d had higher-capacity gun magazines. He wrote that although mass shootings are “tragic,” they are far less prevalent than robberies, aggravated assaults and homicides in homes — and those more common crimes sometimes require maximum firepower because “unless a law-abiding individual has a firearm for his or her own defense, the police typically arrive after it is too late.

“The size limit (on magazines) directly impairs one’s ability to defend one’s self,” he wrote.

The NRA released a statement Friday hailing the decision as “huge win for gun owners” and a “landmark recognition of what courts have too often treated as a disfavored right.”

The NRA predicted in the statement that the ruling will be appealed to the Ninth Circuit court, but added that “the thoroughness of Judge Benitez’s analysis should give Second Amendment supporters the best possible chance for success in appellate proceedings.”

Ari Freilich, an attorney with the Giffords Law Center, which filed an amicus brief in opposition to the NRA suit, said the ruling was “an extreme outlier” and “not unexpected, given who the judge is.”

“In this ruling, the judge writes, ‘the problem of mass shootings is very small,’ and that probably sums this up,” Freilich said. “We disagree.”

Chronicle Staff Writer Bob Egelko contributed to this report.

Kevin Fagan is a San Francisco Chronicle staff writer. Email: kfagan@sfchronicle.com Twitter: @KevinChron