A federal judge on Friday overturned California’s 32-year-old ban on assault weapons, calling it a “failed experiment” and said it is unconstitutional. 

Judge Roger T. Benitez of the U.S. District Court for the Southern District of California, argued the ban deprived law-abiding Californians of weapons commonly allowed in other states. The judge also said AR-15 rifle was “the ideal weapon.”

“Like the Swiss Army Knife, the popular AR-15 rifle is a perfect combination of home defense weapon and homeland defense equipment,” he wrote. “Therefore, this Court declares the California statutes to be unconstitutional.”

The judge has granted a 30-day stay of the ruling that would allow Attorney General Rob Bonta to appeal the decision. 

“Today’s decision is fundamentally flawed, and we will be appealing it,” Bonta said in a statement. “There is no sound basis in law, fact, or common sense for equating assault rifles with swiss army knives.”

Last month, a rail yard employee in San Jose used an AR-15 to open fire at the Santa Clara Valley Transportation Authority site. The mass shooting led to the deaths of 10 people, including the suspect, who turned the gun to himself after the shooting spree. 

Earlier this year, a man used an AR-15 style rifle to fire and kill 10 people at the King Soopers grocery store in Boulder, Colorado.