An implantable magnet that can freely turn in response to an external magnetic field, thus avoiding torque and demagnetization on the implantable magnet. The implantable magnet can be combined with an electric switching function depending on the orientation of an external magnetic field, thus protecting an implanted coil and/or implant electronics against induction of over-voltage or performing an electric switching function for other various purposes. The magnetic switch may further include, for example, a first switching contact and a second switching contact. A magnetically soft body that includes an electrically conductive surface is shiftable between a first position where the body is in simultaneous contact with the first and second switching contacts, and a second position where the body is out of contact with at least one of the first and second switching contacts. The body and the implantable magnet are positioned such that the body is shifted to one of the first position and the second position as a function of the external magnetic field resulting in a magnetic force between the magnet and the magnetically soft body.