A federal judge on Monday blocked a California law that restricts the sale of new handguns. 

U.S. District Court Judge Cormac Carney said parts of the legislation violate the Second Amendment

He wrote that the state's requirements for new handguns are unconstitutional and cannot be enforced. 

Because of these restrictions, Carney wrote, no new models of semiautomatic handguns have been approved for sale since 2013 and Californians are forced to buy older and potentially less safe models.

INDIANA LEGISLATORS LOOK TO BAN AUTOMATIC FIRE-INDUCING 'GLOCK SWITCHES'

.45-caliber ammunition

Chris Puehse, owner of Foothill Ammo, displays .45-caliber ammunition for sale at his store in Shingle Springs, California, on June 11, 2019. (AP Photo/Rich Pedroncelli, File)

He issued a preliminary injunction to take effect in two weeks, giving the state Department of Justice time to appeal. 

A lawsuit challenging the law was filed last year by the California Rifle & Pistol Association and other gun rights supporters.

California law requires new handguns to have a chamber load indicator, a magazine disconnect mechanism and microstamping capability.

"No handgun available in the world has all three of these features," Carney, who was appointed by Republican President George W. Bush, said. "These regulations are having a devastating impact on Californians’ ability to acquire and use new, state-of-the-art handguns."

GOP MOVES TO BLOCK BIDEN'S PISTOL BRACE RULE: 'ABUSE OF RULE-MAKING AUTHORITY'

Older handguns have been grandfathered into a list – a "roster" – of guns that pass a safety test under state law known as the Unsafe Handgun Act.

"Californians have the constitutional right to acquire and use state-of-the-art handguns to protect themselves," Carney added. "They should not be forced to settle for decade-old models of handguns to ensure that they remain safe inside or outside the home."

Previous attempts to challenge the law, filed before last year’s landmark Supreme Court ruling, had failed.

Anti-gun rights demonstrators in Los Angeles

Activists hold sign during a demonstration in front of Los Angeles City Hall to protest U.S. gun violence on May 31, 2022. (Reuters/Lucy Nicholson/File Photo)

"The fact of the matter is, California’s gun safety laws save lives, and California’s Unsafe Handgun Act is no exception," Attorney General Rob Bonta said in a statement. "We will continue to lead efforts to advance and defend California’s gun safety laws. As we move forward to determine next steps in this case, Californians should know that this injunction has not gone into effect and that California’s important gun safety requirements related to the Unsafe Handgun Act remain in effect."

CLICK TO GET THE FOX NEWS APP

"For decades this ‘roster’ law has deprived law-abiding citizens of the right to choose a handgun appropriate for their individual needs," Chuck Michel, head of the California Rifle & Pistol Association, said Monday. "If we can hold on to this great Second Amendment win, people will be able to choose from among thousands of the latest, greatest and safest handguns made today."

Reuters and The Associated Press contributed to this report.