The incident, which occurred on 16 May, was kept secret by police until now "for tactical reasons relating to the investigation."
Police spokesman Anton Schentz said the young man has a penchant for pyrotechnics. "The whole thing was really dangerous to life."
The 17-year-old is charged with placing 80 grams of black powder, taken from fifty signal and blank firing cartridges, inside a ten centimetre long and one centimetre thick steel pipe.
Schentz added that the young man had sealed both ends, and inserted a 25 cm long fuse.
After making the explosive device, the accused had driven with it on his moped into the vocational school in Hallein.
He showed cell phone pictures of the device to his classmates, saying "Today, we let it rip."
Police officers received a warning, and moved quickly to seize the bomb. According to an explosives expert, "It was no longer a prank."
A search of the young man's apartment revealed a gas gun and a hunting knife.
"It remains to be clarified how he had obtained the cartridges and the detonation cord", said Schentz.