A federal judge ruled has ruled that the Trump administration violated federal law when it allowed a Texas company to publish blueprints online for 3D-printed guns.

In his ruling, published Nov. 12, U.S. District Judge Robert Lasnik granted a motion for summary judgment, ruling that the administration’s decision to allow the “unlimited distribution” on the internet of data files for untraceable, undetectable 3D-printed guns was “arbitrary, capricious and unlawful.”

The motion for summary judgment was filed by Washington State Attorney General Bob Ferguson in July 2018.

'DONALD TRUMP SCREEN OF DEATH': PRESIDENT'S LIKENESS USED AS RANSOMWARE BAIT'

At the center of the case is Defense Distributed – a company formerly headed by gun-rights activist Cody Wilson – and its battle to post CAD files for 3D guns on its website. In 2015, Defense Distributed sued the federal government after the U.S. State Department forced the removal of the files from the internet.

The State Department under President Obama banned the posting of the gun blueprints because, among other reasons, it said the blueprints violated federal export laws since files could be downloaded outside the U.S.

The Trump State Department pushed back, effectively allowing Defense Distributed to publish CAD files for the production of 3D-printed weapons. Following this, eight states and the District of Columbia filed a lawsuit to stop publication of the blueprints. More states later joined the lawsuit.

In July 2018, Judge Lasnik granted Attorney General Ferguson’s request to block internet distribution of the files, the day before Defense Distributed planned to release them. The court later blocked the release of the files for the duration of the lawsuit.

Cody Wilson, however, had continued to sell guns directly to customers, taking advantage of a loophole.

FBI WARNS OF NEW CYBER THREAT TO US THAT INVOLVES 'WHOLE VARIETY' OF ACTORS FROM CHINA

Overall, the Department of State concluded that the worldwide publication of computerized 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," Judge Lasnik wrote, supporting the Obama State Department’s position.

Attorney General Bob Ferguson cited a tweet by President Trump in a statement this week.

“Even the president himself said in a tweet that this decision didn’t make any sense — one of the rare instances when I agreed with him. I’m thankful the court agrees, too,” Ferguson said in a statement.

In July 2018, President Trump tweeted that he was "looking into 3-D plastic guns being sold to the public," adding that it doesn’t seem to make much sense!”

CLICK HERE TO GET THE FOX NEWS APP