San Francisco extracted a legal settlement Tuesday from online gun suppliers who may have tried to sidestep state and local bans on high-capacity gun magazines by advertising “repair kits” that could be used to assemble the forbidden weapons’ cartridge holders.

But the settlement, announced by City Attorney Dennis Herrera, is just a preliminary to the main events that may soon determine the extent of the right to own and carry a gun in California and across the nation.

Herrera sued five out-of-state companies in February, accusing them of violating state laws prohibiting the sale of gun magazines that can hold more than 10 rounds. He said Tuesday the companies have agreed to a 10-year settlement that forbids them from selling or advertising the repair kits in California and requires them to notify customers on their websites that the kits and the large-capacity magazines are illegal in the state.

“Californians have spoken clearly. We don’t want these weapons in our communities,” Herrera said in a statement. “I have zero tolerance for gun sellers who try to skirt the law.”

The companies are Badger Mountain Supply of Washington state, 7.62 Precision of Alaska, Shooters Plus of Mississippi, LAK Supply of Wyoming and BuyMilsurp.com of Florida.

Herrera’s lawsuit, filed in San Francisco Superior Court, said the companies falsely told customers that the kits were legal in California.

For example, the suit said, Badger Mountain Supply advertised that it would sell “rebuild kits” in two separate shipments so that California customers could obtain them legally. LAK Supply’s website said, “All hi cap magazine orders from ban states will automatically be converted” into orders for repair kits.

Sean Brady, a lawyer for 7.62 Precision, Shooters Plus and BuyMilsurp.com, accused Herrera of a “politically motivated shakedown of tiny businesses that can’t afford to defend themselves.” Brady said the websites singled out in the lawsuit haven’t been used by his clients for years to advertise or sell products in California.

But Brady, whose law firm also represents the National Rifle Association and its state affiliate, the California Rifle and Pistol Association, said those organizations “believe in the constitutionality of these products and will be challenging the restrictions on these magazines as soon as possible.”

Another group, the California Firearms Policy Coalition, has already filed suit contending the state’s ban on high-capacity magazines violates both the constitutional right to keep and bear arms and the prohibition on government confiscation of private property.

California law has banned the sale of high-capacity magazines since 2000. A 2013 law specified that the magazines could not be sold in disassembled pieces. A San Francisco city ordinance prohibited possession of high-capacity magazines in 2014, and California voters took the same step in November by passing Proposition 63, whose ban on possession takes effect in July.

Meanwhile, the U.S. Supreme Court, with the addition of Justice Neil Gorsuch, President Trump’s appointee, is weighing whether to take up a challenge to California’s concealed-weapons law. That law requires a law enforcement permit — virtually unavailable in the Bay Area and most of the state’s larger cities — to carry a concealed handgun outside the home.

A federal appeals court upheld the law last year and ruled that the constitutional right to keep a gun at home for self-defense, established by the Supreme Court in 2008, does not apply to carrying concealed weapons outside the home. That issue, crucial to the validity of many state and local gun laws, has never been decided by the high court.

“The mystery is what’s going to happen with Gorsuch,” who could cast the deciding vote, said David Levine, a law professor at UC Hastings in San Francisco. He said last year’s appeals court ruling, which relied on laws and treatises from 15th and 16th century England to find no traditional Anglo-American right to carry concealed weapons, was clearly drafted to appeal to jurists like Gorsuch who claim to interpret the law according to its original meaning.

UCLA l aw Professor Adam Winkler said cases like Herrera’s settlement Tuesday reflect broader trends in a gun-control movement that “has been reinvigorated in recent years,” with California at the forefront.

“Gun control has become a higher priority for Democrats in recent years, including prosecutors who may now be more aggressive in going after people or companies that seek to evade California’s strict gun regulations,” Winkler said.

Brandon Combs, president of the California Firearms Policy Coalition, said those prosecutors could overstep their limits, even in California. For example, he said, the state and city might exceed constitutional boundaries on interfering with interstate commerce if they try to enforce the gun-kit ban against dealers who receive the products in this state for sale and shipment to states where they’re legal.

“The broader these gun-control laws get, (and) the ... more expensive, it’ll be interesting to see how they’re enforced outside state lines,” Combs said.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko<DP>@<DP>sfchronicle.com Twitter: @egelko