A Japanese man was sentenced to two years in prison Monday for using a 3D-printer to make guns at his home.

The Yokohama District Court ruled that 28-year-old Yoshitomo Imura also violated the law by publishing a video showing how he made the two guns, which are able to work, according to Discovery News.

While presiding judge Koji Inaba said this was a serious criminal act because it might encourage other people to make guns of their own, Imura's lawyers argued that he didn't know that what he was doing was against the law. Japan currently has strict rules when it comes to gun control, and there are few people in the country that own a firearm. Police in Japan, however, still carry guns.

Imura is shown in his YouTube video firing one of the guns in a wooded area, PCWorld reported. A prison term of three years was demanded for Imura by prosecutors. Defense lawyer Akira Noguchi said after the ruling that the court has yet to decide on an appeal.

Imura's firearm is not the first 3D-printed gun to be created, as that title goes to Cody Wilson's Liberator.

Guns made at home have been a subject of debate in the U.S. since Defense Distributed, a nonprofit group in Texas, posted blueprints last year of a single-shot pistol made with a 3D printer, Discovery News reported.

Debates have also been held about the legality of 3D-printing technology, with some worrying that weapons made with this technology can be used for hijacking since they can't be detected by airport scanners and other regular security equipment.