June 30 (Reuters) - A federal judge on Thursday blocked a California law set to take effect July 1 that bans residents under many circumstances from owning a firearm magazine capable of holding more than 10 rounds of ammunition, court documents showed.

U.S. District Judge Roger Benitez, in San Diego, issued a preliminary injunction halting the law while he takes up the underlying complaint filed last month by five California residents backed by the California Rifle & Pistol Association, a lobby group.

“If this injunction does not issue, hundreds of thousands, if not millions, of otherwise law-abiding citizens will have an untenable choice: become an outlaw or dispossess one’s self of lawfully acquired property,” Benitez wrote in his 66-page order.

California has some of the nation’s most complex gun laws. Battles over guns in California are part of a fierce debate over gun-control measures in the wake of deadly mass shootings across the United States, including the 2015 rampage at a holiday party in San Bernardino.

Since 2000, California has prohibited buying, selling, or importing “large-capacity” magazines capable of accepting more than 10 rounds, according to the complaint. There are some exceptions, including for active and retired law enforcement officers and for movie actors using a large magazine as a prop.

Voters expanded the law last year under Proposition 63 to prohibit the possession of such magazines and impose penalties on violators that can include up to one year in jail and a fine of $100 per magazine, the complaint said.

The plaintiffs argue the law violates their rights under the U.S Constitution to bear arms and receive due process, and against the government seizing their property without just compensation, the complaint said.

California Attorney General Xavier Becerra, tasked with defending the law, argued in opposition to the motion for a preliminary injunction that the magazines are not protected by the Second Amendment and are featured prominently in some of the most serious crimes, including mass shootings.

“Restricting large-capacity magazines and preventing them from ending up in the wrong hands is critical for the well-being of our communities,” Becerra said in a statement following the order.

It was unclear whether Becerra would appeal the order to the U.S. Court of Appeals for the Ninth Circuit.

The order was cheered by the California Rifle & Pistol Association, which is associated with the National Rifle Association, and the San Diego County residents who either own, or are seeking to buy, higher capacity magazines.

“Law abiding gun owners have a right to choose to have these magazines to help them defend themselves and their families,” said Chuck Michel, a lawyer for the plaintiffs.

Separately on Thursday, a federal judge in Sacramento denied a motion for a preliminary injunction in a similar lawsuit challenging Proposition 63, Becerra said.