Background: Neuromodulation is a rapidly expanding therapeutic option considered within neuropsychiatry, pain and rehabilitation therapy. Combining electrostimulation with feedback from fMRI can provide information about the mechanisms underlying the therapeutic effects, but so far, such studies have been hampered by the lack of technology to conduct safe and accurate experiments. Here we present a system for fMRI compatible electrical stimulation, and the first proof-of-concept neuroimaging data with deep brain stimulation (DBS) in pigs obtained with the device., New Method: The system consists of two modules, placed in the control and scanner room, connected by optical fiber. The system also connects to the MRI scanner to timely initiate the stimulation sequence at start of scan. We evaluated the system in four pigs with DBS in the subthalamic nucleus (STN) while we acquired BOLD responses in the STN and neocortex., Results: We found that the system delivered robust electrical stimuli to the implanted electrode in sync with the preprogrammed fMRI sequence. All pigs displayed a DBS-STN induced neocortical BOLD response, but none in the STN., Comparisons With Existing Method: The system solves three major problems related to electric stimuli and fMRI examinations, namely preventing distortion of the fMRI signal, enabling communication that synchronize the experimental conditions, and surmounting the safety hazards caused by interference with the MRI scanner., Conclusions: The fMRI compatible electrical stimulator circumvents previous problems related to electroceuticals and fMRI. The system allows flexible modifications for fMRI designs and stimulation parameters, and can be customized to electroceutical applications beyond DBS., (Copyright © 2022 The Authors. Published by Elsevier B.V. All rights reserved.)