A federal judge in Washington state has blocked the Trump administration from allowing blueprints for making plastic guns on 3D printers to be posted on the internet, ruling that the move violated federal procedures.

The judge, Robert Lasnik of the US District Court in Seattle, said that the government violated federal law in July 2018, when the State Department said the blueprints could be posted online.

The department previously held that export laws banning the foreign distribution of firearms prevented the publication of the blueprints.

Among the procedural steps the US State Department should have followed was a requirement to give Congress advance notice of such an action, Mr Lasnik said. He said that the federal government did not offer a “reasoned explanation” for its reversal.

Mr Lasnik said in the 25-page order that the federal government “must do more than simply announce a contrary position”.

3D printing for dummies: How do 3D printers work? Show all 4 1 / 4 3D printing for dummies: How do 3D printers work? 3D printing for dummies: How do 3D printers work? 3D-printer-4.jpg AP 3D printing for dummies: How do 3D printers work? 3D-printer.jpg Getty Images 3D printing for dummies: How do 3D printers work? 3D-printed-chocolate.jpg Reuters 3D printing for dummies: How do 3D printers work? 3D-printer-2.jpg Reuters

“The Department of State concluded that the worldwide publication of computerised instructions for the manufacture of undetectable firearms was a threat to world peace and the national security interests of the United States and would cause serious and long-lasting harm to its foreign policy,” Mr Lasnik said, referring to the department’s earlier findings.

Tuesday’s ruling, which is likely to be appealed, stoked the long, fierce debate over 3D printed firearms.

Proponents have asserted that there is a First Amendment right to publish such materials, while critics have argued that allowing 3D printed firearms could lead to increased gun violence and allow criminals and terrorists to skirt gun control legislation.

Nineteen states and the district of Columbia sued last year over the State Department’s move.

“It is baffling that the Trump administration continued to work so hard to allow domestic abusers, felons and terrorists access to untraceable, undetectable 3D printed guns,” said Bob Ferguson, the attorney general of Washington, one of the states that sued the department.

Edward Markey, senator of Massachussets – another state in the lawsuit – said on Twitter that the decision was “a victory for gun safety and the rule of law, and a defeat for Donald Trump, who is afraid to stand up and protect Americans from gun violence”.

The White House did not immediately respond to requests for comment on Tuesday evening.

The State Department said on Tuesday evening that it was “continuing to review the Washington court’s order”, and referred further questions to the Department of Justice, which has declined to comment.

Mr Lasnik’s ruling also did not directly settle the First Amendment arguments raised by those who support the blueprints’ publication because the State Department “has not attempted to justify its action as compelled by the First Amendment”, the judge’s order stated.

The roots of the case stretch back to 2012, when Defence Distributed, a non-profit based in Austin, Texas, began publishing schematics for certain weapons on its website.

Cody Wilson, a champion of gun rights and anarchism from Texas who founded Defence Distributed, had claimed a First Amendment right to publish the blueprints. Mr Wilson declined to comment.

Chad Flores, a lawyer for Defence Distributed, which is a party in the case, said that while federal procedures were important, the “constitution is always paramount”.

3D printer unveiled which can print a house in less than 24 hours

“With today’s unprecedented ruling, a few rogue state officials have commandeered the State Department to do their unconstitutional bidding nationwide,” Mr Flores said. “Defence Distributed will be appealing and fully expects a swift reversal.”

Since at least 2013, the State Department said it could regulate the blueprints and restricted their publication online. The State Department also asked Defence Distributed to remove some of the files it had uploaded, Mr Lasnik said.

Defence Distributed sued the State Department in 2015, spurring years of rulings and appeals until June 2018, when the State Department reversed itself and concluded the schematics did not violate controls meant to keep certain military technology out of the hands of the country’s enemies.

A court-approved settlement in July 2018 between the State Department and Mr Wilson ended the legal case and gave Mr Wilson the right to distribute the schematics.

Then Washington and other states sued to prevent the publication. Mr Lasnik issued a temporary order against the Trump administration in July 2018.

Tuesday’s ruling was a motion for summary judgment, meaning that the case would not have to go to trial, Mr Ferguson said.