Amid a national outcry and a spate of legal challenges, a federal judge in Washington state issued a restraining order late Tuesday that effectively blocked the Texas group that planned to publicly post files Wednesday that would enable people to make 3D-printable guns.

Acting in a lawsuit joined by Democratic attorneys general in several states, including Pennsylvania and New Jersey, Judge Robert S. Lasnik temporarily suspended the Trump administration decision that allowed Defense Distributed to post the files, the Washington state attorney general said.

"If an injunction is not issued and the status quo alters at midnight tonight, the proliferation of these firearms will have many of the negative impacts on a state level that the federal government once feared on the international stage," Lasnik wrote in his order, saying the attorneys general had shown "a likelihood of irreparable injury" if the files were to be posted.

It came less than a day before the nonprofit had planned to release more downloads for creating 3D-printed guns, saying it planned to unleash "the new era of downloadable guns" on Wednesday.

Shortly before Lasnik's ruling, Defense Distributed had agreed not to upload any new files until a court hearing next month in New Jersey, officials said, but files already posted on the nonprofit's website would have been allowed to stay.

The Washington decision applies to all files, and all computers nationwide, by blocking the federal settlement that permitted Defense Distributed to disseminate the "blueprints" for the 3D-printable guns in the first place.

Cody Wilson, the director of the group, said the site would disable all the available 3D-printable firearm blueprints until he reviewed the judge's decision, CNN reported late Tuesday.

The Brady Campaign, one of the most prominent gun-control groups, praised the ruling.

"It is immediately obvious to anyone who looks at this issue that 3D-printed guns are nothing short of a menace to society, and we are thrilled that the court ruled in this manner," said Avery Gardiner, its co-president. "We will continue to do everything in our power to make sure that this temporary halt in publication becomes a permanent one."

A similar request for an injunction was also pending in Pennsylvania, where Attorney General Josh Shapiro had won a temporary block on the website that prevents anyone in the state from accessing it. Shapiro called the Washington judge's order "a tremendous win for public safety and common sense."

As activists and lawmakers sought to intervene Tuesday, arguing that public access to the files posed a national security threat, President Trump's State Department defended its decision to end a years-long legal battle to block Defense Distributed from sharing the files. That came hours after the president himself tweeted that the idea of 3D-printable guns "doesn't seem to make much sense!"

Wilson has framed the debate as a First Amendment issue, arguing the right to free speech allows him to publish the code that creates the guns.

"Americans have the right to this data," he told the Inquirer and Daily News on Sunday. "We have the right to share it."

The 3D technology allows someone to print a working gun without passing a background check or using a licensed gun dealer. The firearms don't have serial numbers, so they aren't traceable by law enforcement, and they cannot be detected by a metal detector unless they have metal parts. Made out of plastic, they sometimes are not durable, and require access to a 3D printer. They fire bullets, as a regular gun would.

Wilson, a 30-year-old from Austin, Texas, had fought the federal government since 2013 for the right to post the gun "blueprints" online. First under the Obama administration, then under Trump, the State Department blocked the group from publishing, raising concerns about downloads by people in other countries. But a few weeks ago, the State Department reversed course and agreed to a legal settlement allowing Defense Distributed to post the files as soon as Wednesday.

Lawmakers this week had called on Trump and Secretary of State Mike Pompeo to reverse last month's government settlement with Wilson that allowed him to post the files.

Trump said in his Tuesday morning tweet that he would look into the issue and that he had spoken to the National Rifle Association, but didn't elaborate.

But later Tuesday, the administration doubled down on its decision to allow the gun downloads. In a response to the Washington state lawsuit that sought to suspend the settlement, it said the Department of State lacks the jurisdiction to regulate the downloads because they involve "defense articles and services, or technical data related thereto, to U.S. persons on U.S. soil."

The attorneys general of Pennsylvania and New Jersey both got Defense Distributed to block the website downloads in their states earlier this week, preventing residents from accessing them, and have filed separate suits against the group. In addition, both on Monday joined the group lawsuit led by Washington Attorney General Bob Ferguson.

"These ghost guns are untraceable, virtually undetectable and, without today's victory, available to any felon, domestic abuser or terrorist," Ferguson, a Democrat, said in a statement after the judge's ruling. "I am thankful and relieved Judge Lasnik put a nationwide stop to the Trump Administration's dangerous decision to allow downloadable, 3D-printed ghost guns to be distributed online."

A group of Democratic senators also introduced a bill Tuesday to block the publication of the files and to ban untraceable or undetectable weapons by requiring all to have a permanent metal piece with a serial number. A similar bill is being introduced in the House by Rep. David N. Cicilline (D., R.I.).

"It's incumbent on we in Congress to do everything to stop these websites before the damage by a mass shooter or a terrorist occurs," said Senate Minority Leader Chuck Schumer (D., N.Y.).

But there was no evidence the measure could gain any traction in the Republican-controlled Congress; acknowledging the legislative process might be too slow, the senators implored Trump to act.

It is difficult to predict what effect the 3D-printed gun downloads would have. Some on social media have pointed out that such online templates are already available, and there are other ways to obtain illegal guns.

Wilson had made much of the advent of the technology: After the settlement with the federal government, he tweeted a photo of a gravestone engraved with the words American gun control.

Others, including politicians fighting to block the files, say the guns would be easier to conceal and impossible to trace.

"You will see them around our streets, in our airports, our train stations; they are undetectable, untraceable. Forget about the TSA guarding the plane," said Sen. Richard Blumenthal (D., Conn.).

The state attorneys general, in a letter to Pompeo, contended the federal settlement would give "terrorists, criminals, and individuals seeking to do harm … unfettered access to print and manufacture dangerous firearms." Others contend the proliferation of such firearms could also take business away from the traditional gun industry, the companies that the NRA represents, and confound law enforcement in attempts to reduce gun violence or get illegal guns off the street.

The NRA, which had largely stayed out of the debate, said late Tuesday afternoon that the technology would not cause a proliferation of 3D-printed guns.

"Many anti-gun politicians and members of the media have wrongly claimed that 3D printing technology will allow for the production and widespread proliferation of undetectable plastic firearms," Chris W. Cox, executive director of the NRA Institute for Legislative Action, said in a statement. "Regardless of what a person may be able to publish on the Internet, undetectable plastic guns have been illegal for 30 years."

When Wilson first published plans for 3D-printable guns in 2013, they were downloaded more than 100,000 times, the Associated Press reported. The files posted by Defense Distributed on Friday were downloaded about 2,500 times, Wilson told the New York Times.

Staff writers Tom Avril and Jonathan Lai contributed to this article.