Zhou Mi (周密 ; 1232-1298 AD), who lived during China's Southern Song Dynasty and the Mongol Yuan Dynasty led in his day by the formidably obese Kublai Khan, describes a rather terrifying event when incompetence on the part of inexperienced n00bs with gunpowder led to a massive unexpected explosion in 1280 AD of a pre-modern factory at Weiyang producing gunpowder. The following passage is found in his Guixin Zazhi (癸辛雜識), published in 1295 AD. Just for reference, the passage mentions the Chinese unit of distance called a li, which is about 500 m (1,600 ft), but during the late Song and early Yuan was IIRC the Tang-era measurement of about 323 m (1,060 ft) was still being used (correct me if I'm wrong about that). It's basically comparable to about a fifth of an English mile (5,200 ft or 1.6 km).
Anyways, on to the incompetence!
This translation is provided by Joseph Needham, Science and Civilization in China: Volume 5, Chemistry and Chemical Technology, Part 7, Military Technology; the Gunpowder Epic (Taipei: Caves Books, Ltd., 1986), pp. 209-210.
Dear God, man, that's a huge explosion. I don't think Antonio Banderas could walk away comfortably from this one.Originally Posted by Zhou Mi, Guixin Zazhi (癸辛雜識), 1295 AD
It's pretty impressive, considering how the Chinese formula for gunpowder (the earliest known written example being in the Wujing Zongyao of 1044 AD) wasn't refined enough yet in the previous 12th century to rip through cast iron casings of catapult-lobbed bombs. Yet by the mid 13th century nitrate levels in the improved formula reached above 90%, which was enough to shred through metal, not just weak paper casings used before in such Chinese bombs. This is around the same time that the first bronze "hand cannons" appeared in China as seen in modern archaeological finds. Fast forward to about the middle of the 14th century and both China and medieval Europe are using the first bombards, the earliest gunpowder-based artillery.
Another thing to take from this passage is that the Mongols could not be trusted with gunpowder. I mean just look at them. Disgraceful. Look at their failed invasion of Japan. Disgraceful. Nomads who live on horses should know better and trust the handling of such things by their betters, the Chinese.