Alchemists in Tang dynasty China experimented with saltpeter, sulfur and charcoal and recorded that the mixture could burn fiercely or explode.
It was used for fireworks and then weapons, including fire arrows and bombs, and spread across Eurasia in the following centuries.