magnetic mine

a naval mine designed to explode when the metal hull of a ship passing near it deflects a magnetic needle, closing an electric circuit and thus detonating the charge

See magnetic mine in American Heritage Dictionary 4

noun
A marine mine detonated by a mechanism that responds to a mass of magnetic material, such as the steel hull of a ship.
link/cite print suggestion box