Chinese alchemists, probably seeking an elixir of life, had formulated gunpowder from saltpetre, sulphur and charcoal by the ninth century during the Tang dynasty. By the thirteenth century, under the Song, it was being used in incendiary bombs, fire-lances and early tube weapons. Knowledge spread westward along trade and conquest routes, and by the fourteenth century cannon powerful enough to batter stone walls had appeared in Europe. The technology transformed both siege warfare and the design of defences.
Gunpowder artillery eventually made tall medieval curtain walls indefensible, forcing the shift to low, thick, angled bastion fortifications (the trace italienne) that reshaped the perimeter, scale and growth limits of early-modern cities.