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. 