An implantable medical device configured to connect to function conductor(s) to transmit therapeutic signals or diagnostic signals or both. Includes a controllable voltage/current source or adjustable terminating impedance for the function conductor and a control unit that is connected to the voltage or current source or adjustable terminating impedance. The control unit controls a voltage, or a current to be applied to the function line, or to adjust the terminating impedance. Includes an interference field sensor connected to the control unit, and to detect an alternating electromagnetic or magnetic field, and to supply an output signal, upon detection. The control unit controls the voltage/current source as a function of the output signal of the interference field sensor, or sets the adjustable impedance so that a voltage induced as the result of an alternating electromagnetic or magnetic field is compensated for at the distal end of the electrode line.