SACRAMENTO, Calif. (AP) — California’s efforts to strengthen what already are some of the nation’s strictest gun laws took two blows this week, the latest coming when a federal judge blocked a law set to take effect Saturday that would have barred gun owners from possessing high-capacity ammunition magazines.

The judge ruled Thursday that the ban approved by the Legislature and California voters last year takes away gun owners’ Second Amendment rights and amounts to the government seizing people’s private property without compensation.

California law has prohibited buying or selling the magazines since 2000, but until now allowed those who already owned them to keep them.

Allowing the law to take effect would have given thousands of otherwise law-abiding citizens what San Diego-based U.S. District Judge Roger Benitez called an untenable choice: “Become an outlaw or dispossess one’s self of lawfully acquired property.”

He issued a preliminary injunction blocking the law from taking effect while he considers the underlying lawsuit filed by the National Rifle Association-affiliated California Rifle & Pistol Association.

Earlier this week, California regulators temporarily blocked proposed new rules on assault weapons submitted by Attorney General Xavier Becerra in May. The Office of Administrative Law said Becerra went too far in trying to impose the new regulations without allowing for public comment.

Becerra’s office is developing regulations on how current owners of soon-to-be-illegal assault-style weapons can keep them if they’re registered starting in July 2018.

Becerra, who also is defending the high-capacity magazine ban, criticized the San Diego judge’s decision without saying what he will do next on either setback.

“Proposition 63 was overwhelmingly approved by voters to increase public safety and enhance security in a sensible and constitutional way,” he said in a statement. “I will defend the will of California voters because we cannot continue to lose innocent lives due to gun violence.”

Lawyers representing both sides said Becerra can appeal both decisions.

“Unfortunately this law will be delayed but we are confident it will go into effect, and soon,” said Ari Freilich, staff attorney at the Law Center to Prevent Gun Violence. He called the San Diego lawsuit and ruling part of the NRA’s efforts “to delay and dismantle California’s law brick by brick.”

Had the ban taken effect, owners would have been required to get rid of their magazines by sending them out of state, altering them to hold no more than 10 bullets, destroying them or turning them into law enforcement agencies.

Owners can now keep the magazines until a final ruling by Benitez or if an appeals court overturns his injunction, said Chuck Michel, attorney for the NRA and the California Rifle & Pistol Association.

“This court recognized that the Second Amendment is not a second-class right and that law-abiding gun owners have the right to own these magazines to defend themselves and their families,” Michel said.

State lawmakers approved the ban last year as part of a package of gun restrictions. Voters agreed in November when they approved Proposition 63, a measure that toughened the penalties by allowing violators to be fined or jailed.

Benitez criticized Becerra’s arguments that magazines often holding 30 or 100 bullets are typically used in mass shootings and aren’t needed by hunters or civilian owners. Forcing assailants to change magazines more frequently gives victims time to flee or subdue the shooter, Becerra argued in court filings.

He listed as examples the shooting in Orlando, Florida, that killed 49 people and injured 53; the terrorist assault that killed 14 and injured 22 in San Bernardino; the massacre of children and teachers at Sandy Hook Elementary School in Newtown, Connecticut; and the Arizona attack that killed six and wounded 13 including former U.S. Rep. Gabrielle Giffords.

“Persons with violent intentions have used large capacity magazines, machine guns, hand grenades and pipe bombs, notwithstanding laws criminalizing their possession or use,” Benitez wrote. “Trying to legislatively outlaw the commonly possessed weapon de jour is like wearing flip flops on a slippery slope. A downhill slide is not hard to foresee.”

The judge suggested in his ruling that the Attorney General’s office failed to show that banning high-capacity magazines would have a significant effect on limiting mass shootings in California.

Becerra said opponents’ Second Amendment challenge has repeatedly been rejected by other courts, allowing at least seven other states and 11 local governments to already restrict the possession or sale of large-capacity ammunition magazines.