A 19-year-old male admitted Monday in a Nagoya district court to producing a 3D-printed gun, stimulants and a highly powerful explosive often used in terror attacks.

The former university student, whose name is being withheld because he is a minor, produced triacetone triperoxide, known as TATP, at his home in Nagoya in December 2016, according to an indictment.

The explosive was a type used in a number of Islamic State-linked terror attacks including in Paris in 2015 and Brussels in 2016.

(Photo shows a scene from a YouTube video showing how to manufacture triacetone triperoxide, known as TATP)

He is additionally charged with synthesizing stimulants in August 2017 in conspiracy with an 18-year-old male in Ibaraki Prefecture and making a gun by allegedly using a 3D printer around the following month.

While the teenager was initially sent to the Nagoya family court by prosecutors as a minor, the court sent him back to the prosecutors in November after concluding he should face criminal charges in light of the seriousness of the case.

"It is a serious case in which he wrongly used knowledge he obtained online" and behaviors extremely harmful to society escalated, the family court said at the time.

It also said he developed a strong curiosity toward guns and explosives, and wanted to earn money to make them by selling stimulants.

The prosecutors indicted him at the Nagoya District Court in November.