A number of states had argued the plastic guns are "untraceable and virtually undetectable"

A US judge has blocked plans to release blueprints for a 3D-printed gun online - just hours before they were due to appear online.

Several states have complained they'd be untraceable and undetectable 'ghost' firearms.

However, gun rights groups claimed the technology to make them is expensive, the guns are unreliable, and the threat is being overblown.

Eight US states decided to sue the Trump administration after the US government reached a settlement with a group called Defense Distributed, who were due to publish the files online on August 1st.

A number of files had already been published, and downloaded hundreds of times.

However, only hours before the expected publication of more files, a judge in Washington state granted a temporary injunction blocking the publication of the files.

Judge Robert S Lasnik said: "Plaintiffs have shown a likelihood of irreparable injury if the downloadable [Computer Aided Design] files are posted tomorrow as promised."

Washington state's attorney general Bob Ferguson called the decision a 'total, complete victory'.

Washington Attorney General Bob Ferguson, center, speaks with media members following a hearing where a federal judge issued a temporary restraining order to stop the release of blueprints to make untraceable and undetectable 3D-printed plastic guns. Picture by: Elaine Thompson/AP/Press A

He added: "These ghost guns are untraceable, virtually undetectable and, without today’s victory, available to any felon, domestic abuser or terrorist." 

Donald Trump also weighed in on the issue in a brief tweet earlier on Tuesday:

The case is due in court again on August 10th.