A federal judge in Washington state is overturning a settlement between the federal government and Austin-based Defense Distributed that allowed the company to publish plans for 3D-printable guns online last year.

Defense Distributed had been in a years-long legal battle in federal court in Austin over the legality of publishing the plans on the Internet. The State Department had argued the distribution of the plans online would violate federal arms export rules, since they could be accessed from anywhere in the world. But last spring, the State Department suddenly settled with the company, agreeing to modify the rules to allow the plans to be published.

Defense Distributed did so last summer, amid a flurry of last-ditch requests from a coalition of states to block the publication over fears that making the plans available online for free could put untraceable weapons in the hands of people who might be violent. Nineteen states and the District of Columbia filed suit in Washington state arguing the State Department did not follow proper procedure in modifying the arms export rules.

Four days after the publication, U.S. District Judge Robert Lasnik issued an order temporarily halting distribution of the plans, though some had already been downloaded thousands of times and spread to file-sharing sites.

Judge Lasnik issued a ruling Tuesday overturning the State Department’s actions, finding the agency failed to provide Congress with 30 days required under the law.

"Because the agency action was 'without observance of procedure required by law,’” Lasnik wrote, "it must be held unlawful and set aside.”

However, the judge leaves the door open to the State Department trying again to alter the rules, following proper procedure.

The department can also appeal.

Earlier this year, Defense Distributed founder Cody Wilson was charged with sexual assault after he paid a teenager $500 for sex in an Austin motel room. Wilson fled to Taiwan before he was arrested and returned to the U.S. He pleaded guilty to a lesser charge, avoiding jail time, though he was required to pay a fine and register as a sex offender.

He stepped down from his position at Defense Distributed while the criminal charges were pending, though he recently rejoined the company.