California cannot ban gun owners from having detachable magazines that hold more than 10 rounds, a federal judge ruled Friday.

The decision from U.S. District Judge Roger Benitez won’t take effect immediately. California Attorney General Rob Bonta, a Democrat, has already filed a notice to appeal the ruling. The ban is likely to remain in effect while the case is still pending.

This is the second time Benitez has struck down California’s law banning certain types of magazines. The first time he struck it down — way back in 2017 — an appeals court ended up reversing his decision.

But last year, the U.S. Supreme Court set a new standard for how to interpret the nation’s gun laws. The new standard relies more on the historical tradition of gun regulation rather than public interests, including safety.

The Supreme Court ordered the case to be heard again in light of the new standards. It’s one of three high-profile challenges to California gun laws that are getting new hearings in court. The other two cases challenge California laws banning assault-style weapons and limiting purchases of ammunition.

Benitez ruled that “there is no American tradition of limiting ammunition capacity.” He said detachable magazines “solved a problem with historic firearms: running out of ammunition and having to slowly reload a gun.”

“There have been, and there will be, times where many more than 10 rounds are needed to stop attackers,” Benitez wrote. “Yet, under this statute, the State says ‘too bad.’”

Bonta said larger capacity magazines are also important to mass shooters, allowing them to fire quickly into crowds of people without reloading. He said the U.S. Supreme Court made it clear the new standard for reviewing gun laws “did not create a regulatory straitjacket for states.”

“We believe that the district court got this wrong,” Bonta said. “We will move quickly to correct this incredibly dangerous mistake.”

Chuck Michel, president of the California Rifle and Pistol Association, praised Benitez for a “thoughtful and in-depth approach.”

“Sure, the state will appeal, but the clock is ticking on laws that violate the Constitution,” Michel said.

California has been at the forefront of gun restrictions in the United States. Last week, California became the first state to call for an amendment to the U.S. Constitution that would ban assault weapons and gun sales to people under 21, among other changes.

Gov. Gavin Newsom called Benitez’s ruling “a radical decision.”

“Judge Benitez is not even pretending anymore. This is politics, pure and simple,” Newsom said. “It’s time to wake up. Unless we enshrine a Right to Safety in the Constitution, we are at the mercy of ideologues like Judge Benitez.”

Newsom also posted a response on X, saying in part:

“Our gun safety laws will continue to be thrown out by NRA-owned federal judges until we pass a Constitutional Amendment to protect our kids and end the gun violence epidemic in America.”