Gunpowder was invented in 9th-century China as one of the Four Great Inventions, and spread throughout most parts of Eurasia by the end of the 13th century.[3] Originally developed by the Taoists for medicinal purposes, gunpowder was first used for warfare about 904 AD.