An implantable cardiac device that detects and protects against strong magnetic fields produced by MRI equipment is disclosed. The device has a magnetic field sensor for detecting the presence of a relatively weak static magnetic field (102, 110, 118, 122) of a level equivalent to that of a permanent magnet in the vicinity of the device. The device is switched from a standard operating mode (100) where the nominal functions of the device are active, to a specific protected MRI mode (114, 116) in the presence of a magnetic static field of a level corresponding to that emitted by MRI equipment. The device further temporarily switches the device from the standard operating mode (100) to an MRI stand-by state (108) when a magnetic field is detected by the magnetic field sensor such that a subsequent detection of a magnetic field switches the device from an MRI stand-by state to the specific protected MRI mode.