Mining, landmining or undermining is a way of attacking a walled city, fortress or castle during a siege. It has been used since before the Middle Ages. During the Middle Ages, mines or tunnels were dug underneath castles to let soldiers into the castle or to destroy the walls.
The Siege of Petersburg included a "Battle of the Crater" inside a crater made by a big mine explosion. In World War I, trying to break the stalemate of trench warfare, soldiers tunneled under no man's land and put explosives beneath the enemy's trench. On 7 June 1917, as part of the Battle of Messines, the Allies set off hundreds of tonnes of high explosive in 19 mines at the same time. About 10,000 German troops were killed.