A federal judge has granted a preliminary injunction blocking a private defense firm in Texas from sharing files online that could be used to create 3-D printed guns.

U.S. District Judge Robert Lasnik of the Western District of Washington granted the motion on Monday from a coalition of state attorneys general who are suing the Trump administration over those files.

The lawsuit was filed last month after a settlement between Defense Distributed, the private defense firm, and the U.S. State Department allowed the firm to share the files online. Defense Distributed was planning to make the files available for download earlier this month, but was halted by a temporary restraining order granted at the end of July.

The settlement is unique to Defense Distributed, which sued the State Department over a rule that prohibited the files from being shared. The federal agency previously rejected the company's efforts to share the files because, they argued, it was not in the best interest of the country's security to have the plans publicly available.

The State Department then settled with Defense Distributed earlier this year rather than face further litigation over the issue. The agency said in April it would allow a temporary modification of the U.S. Munition List to allow the firm to share files online.

The states claimed the administration did not go through the proper steps to change the rule, which they said would require notifying Congress at least 30 days before it took effect. That has not happened.

Lasnik said in his decision on Monday that based on that alone, the states having standing to bring litigation through the Administrative Procedure Act.

“Plaintiffs have shown a likelihood of success on the merits of their APA claim because the temporary modification of the USML to allow immediate publication of the previously regulated CAD files constitutes the removal of one or more items from the USML without the required congressional notice,” Lasnik wrote.

The State Department has argued that their change to the USML as part of the settlement did not remove a specific item from the list and therefore did not require notice to Congress. The agency has also said their function is to regulate firearm exports, not change domestic gun laws. Lasnik acknowledged that argument in his decision but said allowing notice to Congress would have provided more opportunity for input at the state and federal levels.

“Forcing the federal defendants to give Congress 30 days' notice of the removal of the CAD files from the USML and to seek the concurrence of the Department of Defense would afford other executive branch entities (including the president) an opportunity to impact the decision-making process and would give both Congress and the states a chance to generate any statutes or regulations deemed necessary to address the regulatory void the delisting would create,” Lasnik wrote.

President Donald Trump, last month, said in a tweet that he was “looking into 3-D Plastic Guns being sold to the public” and that the idea “doesn't seem to make much sense!”

The states have also criticized the State Department for providing no tangible evidence that modifying the rule was in the public's best interest.

The attorneys general have pointed to the possible dangers associated with guns that are 3-D printed. Some of the guns can be made completely of plastic without a serial number, making them impossible to detect or track in the event of a crime, for example. The State Department has countered that argument by citing a federal law that prohibits undetectable guns.

Lasnik said in his decision there was no proof the agency had considered the potential risks of changing the rule.

“There is no indication that the department evaluated the unique characteristics and qualities of plastic guns when it was considering the deletion of the small firearms category from the USML,” Lasnik said.

New York Attorney General Barbara Underwood said in a statement after Lasnik's decision that the preliminary injunction will help ensure public safety until the litigation is resolved.

“In yet another victory for common sense and public safety, today a federal court granted our motion for a nationwide preliminary injunction—continuing to block the Trump administration from allowing the distribution of 3-D printed gun files,” Underwood said. “As the court pointed out, we filed suit because of the legitimate fear that adding these undetectable and untraceable guns to the arsenal of available weaponry will only increase the threat of gun violence against our communities.”

Defense Distributed, which is also named in the lawsuit, has argued that the files should be made available to consumers based on free speech rights. They said the public has a right to the information and that since some of it has been leaked, it's already in the public domain anyway. Lasnik said the issue at hand was not over the company's First Amendment claims, but rather over the State Department's actions.

“Whether or not the First Amendment precludes the federal government from regulating the publication of technical data under the authority granted by the [Arms Export Control Act] is not relevant to the merits of the APA claims plaintiffs assert in this litigation,” Lasnik said.

The lawsuit is being led by Washington state Attorney General Bob Ferguson, who is also joined by Underwood and attorneys general from Connecticut, Maryland, New Jersey, Oregon, Massachusetts, Pennsylvania, California, Colorado, Delaware, Hawaii, Illinois, Iowa, Minnesota, North Carolina, Rhode Island, Vermont, Virginia and Washington, D.C.

The State Department has deferred comment to the U.S. Department of Justice on the lawsuit. A spokeswoman for the DOJ declined to comment on the preliminary injunction.