A federal judge in California struck down the state's gun magazine ban Friday, saying it was unconstitutional.

U.S. District Court Judge Roger T. Benitez, who previously served on the California Superior Court and was appointed to the Southern District of California by George W. Bush in 2004, said in his decision that the state's ban on magazines capable of holding any more than 10 rounds severely restricts California residents' Second Amendment rights.

“California’s law prohibiting acquisition and possession of magazines able to hold any more than 10 rounds places a severe restriction on the core right of self-defense of the home such that it amounts to a destruction of the right and is unconstitutional under any level of scrutiny,” Benitez stated in a decision over 80 pages long on Friday.

Since 2000, a measure signed into law by then-Gov. Gray Davis, a Democrat, prohibited state residents from buying or selling magazines which hold 10 or more rounds. Individuals who owned the magazines before then were allowed to keep them under the law. But that provision was overturned in 2015 when California voters approved a referendum known as Proposition 66.

“The magazine ban arbitrarily selects 10 rounds as the magazine capacity over which possession is unlawful. … The ban on magazines that hold more than 10 rounds amounts to a prohibition on an entire class of ‘arms’ that is overwhelmingly chosen by American citizens for the lawful purpose of self-defense,” Benitez ruled.

The National Rifle Association applauded the decision, saying that Benitez fulfilled his constitutional obligation by defending Americans' rights.

“Judge Benitez took the Second Amendment seriously and came to the conclusion required by the Constitution,” NRA's Institute for Legislative Action Executive Director Chris Cox said in a statement. “The same should be true of any court analyzing a ban on a class of arms law-abiding Americans commonly possess for self-defense or other lawful purposes.”

Benitez had temporarily blocked the law from taking effect in 2017.