A naval mine is a self-contained explosive device placed in water to damage or destroy surface ships or submarines. Unlike depth charges, mines are deposited and left to wait until they are triggered by the approach of, or contact with, any vessel or a particular vessel type, akin to anti-infantry vs. anti-vehicle mines. Naval mines can be used offensively, to hamper enemy shipping movements or lock vessels into a harbour; or defensively, to protect friendly vessels and create "safe" zones. Mines allow the minelaying force commander to concentrate warships or defensive assets in mine-free areas giving the adversary three choices: undertake an expensive and time-consuming minesweeping effort, accept the casualties of challenging the minefield, or use the unmined waters where the greatest concentration of enemy firepower will be encountered.
Although international law requires signatory nations to declare mined areas, precise locations remain secret; and non-complying individuals may not disclose minelaying. While mines threaten only those who choose to traverse waters that may be mined, the possibility of activating a mine is a powerful disincentive to shipping. In the absence of effective measures to limit each mine's lifespan, the hazard to shipping can remain long after the war in which the mines were laid is over. Unless detonated by a parallel time fuze at the end of their useful life, naval mines need to be found and dismantled after the end of hostilities; an often prolonged, costly, and hazardous task.
Modern mines containing high explosives detonated by complex electronic fuze mechanisms are much more effective than early gunpowder mines requiring physical ignition. Mines may be placed by aircraft, ships, submarines, or individual swimmers and boatmen. Minesweeping is the practice of the removal of explosive naval mines, usually by a specially designed ship called a minesweeper using various measures to either capture or detonate the mines, but sometimes also with an aircraft made for that purpose. There are also mines that release a homing torpedo rather than explode themselves.