Chinese alchemists of the Tang dynasty discover gunpowder (a mixture of potassium nitrate, charcoal, and sulfur) while seeking elixirs of immortality. The earliest written references to its use in weapons date to the 9th century, in the Zhenyuan miaodao yaolüe. The technology spread to Korea, Japan, and the Islamic world before reaching Europe in the 13th century.