On Tuesday, Judge Robert S. Lasnik ruled that the Trump Administration’s June 2018 decision to allow the sharing of designs for 3D-printed guns online violated federal law.

Some background: In 2013, an activist organization called Defense Distributed posted blueprints for a functional 3D-printed gun online. The Obama administration ordered the group to take the blueprints down.

In 2015, Defense Distributed sued the government, claiming it had a First Amendment right to share the blueprints. The Justice Department argued that doing so violated export laws and threatened both national security and world peace — and both federal trial and appellate courts agreed, ruling against Defense Distributed.

But then in June 2018, the Trump Administration settled with Defense Distributed, granting the company permission to post the blueprints online and paying it nearly $40,000 to cover the legal fees of founder Cody Wilson, who resigned from the company three months later after he was arrested in Taiwan, where he fled after having sex with an underage girl in Texas.

Before Defense Distributed could post the plans online, however, Attorney General Bob Ferguson filed a lawsuit arguing that the Trump Administration’s decision violated both the Constitution and the Administrative Procedure Act, which regulates how federal agencies develop and issue rules.

Essentially, Ferguson asserted that the Trump Administration couldn’t just decide to contradict what the Justice Department previously argued — and Judge Lasnik agreed, calling the decision to allow Defense Distributed to share its blueprints “arbitrary and capricious.”

“Given the agency’s prior position regarding the need to regulate 3D-printed firearms and the CAD files used to manufacture them,” he wrote, “it must do more than simply announce a contrary position.”

Though it’s hard to say whether this will be the end of the legal back-and-forth between Defense Distributed and the federal government, Ferguson appears pleased with Lasnik’s ruling.

“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,” he said. “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.”

READ MORE: Blueprints for 3-D Printed Guns Cannot Be Posted Online, Judge Says [The New York Times]

More on 3D-printed guns: Blueprints for 3D Printed Guns Will Stay (Sort of) Offline, Judge Rules