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.

How long the law stays this way remains to be seen, however. On Sunday, New York senator Charles Schumer called for legislation to make building a gun with a 3D printer illegal, and said he and the New York congressman Steve Israel would introduce the Undetectable Firearms Modernisation Act, which would ban weapons like Wilson's.

Such an act would not be the first setback for Wilson, a law student at the University of Texas. An attempt to raise money for the 3D printed gun project through Indiegogo was thwarted when the crowdfunding website took his pitch offline, citing a breach of rules. After Wilson raised $20,000 through Bitcoin donations, he was hindered again when Stratys seized back his printer.

Defense Distributed acquired a second-hand Stratys, however, and carried on experimenting. Wilson successfully made and tested parts of an AR-15 semi-automatic rifle – the weapon which has been used in a number of mass shootings in the US – before turning his attention to a plastic handgun.