Device and method for detecting electromagnetic fields occurring in imaging magnetic resonance tomography MRT/MRI tests. Relates to an implantable medical device (IMD) comprising a hermetically sealed housing, control unit(s), detection unit(s) for MRT interference fields connected/connectable to control unit(s) and to electrode(s) and/or to antenna(s) and/or coil(s), wherein the MRT interference detection unit contains at least one electro-optical converter which converts induced voltages from the electrode(s) and/or the antenna(s) and/or the coil(s) to optical signals, which are optically transmitted in a potential-free manner within the detection unit for MRT interference fields to an evaluation unit for the detection unit for MRT interference fields, and when a threshold for the optical signal and/or a predetermined periodic occurrence of the optical signals is exceeded, the evaluation unit triggers switching to an MRI-safe state or transmits a corresponding signal to the control unit(s).