The world's first gun made almost entirely by a 3D plastic printer has been successfully fired in Texas.

The successful test of the plastic handgun, which was built by Defense Distributed using an $8,000 3D printer, came after a year of development. The company, which is run by 25-year-old Cody Wilson, now plans to publish the blueprints for the gun online.

Wilson and a companion successfully fired the gun for the first time in Austin, Texas, at the weekend, Forbes reported. A video published online shows the gun held in place by a metal stand, with yellow string attached to its trigger. By yanking on the string, the pair were able to pull the trigger from 20ft away, successfully discharging a .380 caliber bullet.

Defense Distributed's device is controversial because of the way it is made. Fifteen of its 16 pieces were constructed in a second-hand Stratasys Dimension SST 3D printer, Forbes said. The final piece, the firing pin, is a common nail available from any hardware store. The printer used ABS plastic to create the gun parts, which were then slotted together by Wilson. After Forbes's revelation, the BBC filmed a later test, in which Wilson successfully fired the gun by hand.

The Undetectable Firearms Act of 1988 makes it illegal to manufacture in the US any firearm that is not detectable by walk-through metal detectors. To combat this, Wilson inserted a 6oz piece of steel into the body of his gun, making it legal.